equal
deleted
inserted
replaced
|
1 CC = gcc |
|
2 CFLAGS =-Wall -O2 -fPIC |
|
3 LDFLAGS = -Llib -ltest |
|
4 OBJECTS = func1.o func2.o |
|
5 |
|
6 .c.o: |
|
7 $(CC) -c $(CFLAGS) -shared $< |
|
8 |
|
9 all: lib/libtest.so.1.0.1 prog |
|
10 |
|
11 prog: main.c |
|
12 $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ |
|
13 |
|
14 lib/libtest.so.1.0.1: $(OBJECTS) |
|
15 $(CC) -shared -Wl,-soname,lib/libtest.so.1 $(OBJECTS) -o $@ |
|
16 @echo "Look carefully at this :)" |
|
17 ln -s libtest.so.1.0.1 lib/libtest.so.1 |
|
18 ln -s libtest.so.1.0.1 lib/libtest.so |
|
19 |
|
20 .PHONY: clean |
|
21 |
|
22 clean: |
|
23 rm -f lib/libtest.* |
|
24 rm -f *.o prog |