cmdlineoptions/c/Makefile

40 lines
825 B
Makefile
Raw Permalink Normal View History

all: build static-lib dynamic-lib example compile-tests test
build:
gcc -c -g cmdlineoptions.c
2013-12-26 13:42:05 +01:00
static-lib: build
ar cq libcmdlineoptions.a cmdlineoptions.o
2013-12-26 13:42:05 +01:00
dynamic-lib:
gcc -c -fPIC -g -o cmdlineoptions-dynamic.o cmdlineoptions.c
ld -G cmdlineoptions-dynamic.o -o libcmdlineoptions.so
2013-12-26 13:36:55 +01:00
clean:
rm -f *.o *.a *.so example-shared example-static tests-shared tests-static
2013-12-27 19:59:33 +01:00
example:
gcc -I. -g example.c -o example-shared -L. -lcmdlineoptions
2014-02-22 21:47:27 +01:00
gcc -g example.c -o example-static libcmdlineoptions.a
compile-tests:
gcc -I. -g tests.c -o tests-shared -L. -lcmdlineoptions
gcc tests.c -o tests-static libcmdlineoptions.a
test:
LD_LIBRARY_PATH="." ./tests-shared
./tests-static
install:
cp libcmdlineoptions.so /usr/lib/
cp libcmdlineoptions.a /usr/lib/
uninstall:
rm /usr/lib/libcmdlineoptions.*