feat: libraries lab complete
This commit is contained in:
22
OSs/lab-libs/Makefile
Normal file
22
OSs/lab-libs/Makefile
Normal file
@ -0,0 +1,22 @@
|
||||
all: dynamic static
|
||||
|
||||
dynamic: main.o lib.so
|
||||
gcc $^ -o $@ $(CFLAGS) -lm
|
||||
|
||||
static: main.o lib.a
|
||||
gcc $^ -o $@ $(CFLAGS) -lm
|
||||
|
||||
lib.so: lib.o
|
||||
gcc -shared $^ -o $@ $(CFLAGS)
|
||||
|
||||
lib.a: lib.o
|
||||
ar r $@ $^
|
||||
|
||||
main.o: main.c
|
||||
gcc -c $^ -o $@ $(CFLAGS)
|
||||
|
||||
lib.o: lib.c
|
||||
gcc -c -o $@ -fPIC $^ $(CFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f dynamic static *.so *.o
|
||||
Reference in New Issue
Block a user