2013-12-25 17:27:41 +01:00
|
|
|
|
|
|
|
|
2013-12-27 19:59:33 +01:00
|
|
|
all: build static-lib dynamic-lib example
|
2013-12-25 17:27:41 +01:00
|
|
|
|
|
|
|
build:
|
|
|
|
gcc -c cmdlineoptions.c
|
|
|
|
|
2013-12-26 13:42:05 +01:00
|
|
|
static-lib: build
|
2013-12-25 17:27:41 +01:00
|
|
|
ar cq libcmdlineoptions.a cmdlineoptions.o
|
|
|
|
|
|
|
|
|
2013-12-26 13:42:05 +01:00
|
|
|
dynamic-lib:
|
2013-12-25 17:27:41 +01:00
|
|
|
gcc -c -fPIC -o cmdlineoptions-static.o cmdlineoptions.c
|
|
|
|
ld -G cmdlineoptions-static.o -o libcmdlineoptions.so
|
2013-12-26 13:36:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
clean:
|
2013-12-27 19:59:33 +01:00
|
|
|
rm -f *.o *.a *.so example
|
|
|
|
|
|
|
|
|
|
|
|
example:
|
|
|
|
gcc -ggdb example.c -o example libcmdlineoptions.a
|