diff options
author | Robin Krahl <me@robin-krahl.de> | 2016-02-26 01:40:47 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2016-02-26 01:40:47 +0100 |
commit | 745c643c2f900c8efeb0ac0a8ea3a519b3a790ac (patch) | |
tree | 1cd84b4666b1ba13b5d81699cc940db52c1f6ee8 /Makefile | |
download | dbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.gz dbfp-745c643c2f900c8efeb0ac0a8ea3a519b3a790ac.tar.bz2 |
initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7b67ed2 --- /dev/null +++ b/Makefile @@ -0,0 +1,38 @@ +CFLAGS = -std=c99 -pedantic -Wall -fPIC +CPPFLAGS = -D_XOPEN_SOURCE=700 + +ifneq ($(DEBUG), 1) + CFLAGS += -O2 + CPPFLAGS += -DNDEBUG +else + CFLAGS += -g + CPPFLAGS += -DDEBUG +endif + +CHECK_CFLAGS = $(shell pkg-config check --cflags) +CHECK_LDLIBS = $(shell pkg-config check --libs) + +.PHONY: all check clean + +all: libdbfp.so + +check: libdbfp.so dbfp_check + LD_LIBRARY_PATH=. ./dbfp_check + +clean: + $(RM) libdbfp.so + $(RM) dbfp_check + $(RM) dbfp.o dbfp_check.o + +libdbfp.so: LDFLAGS = -shared +libdbfp.so: dbfp.o + $(CC) $(LDFLAGS) -o $@ $^ + +dbfp_check: LDLIBS += $(CHECK_LDLIBS) +dbfp_check: LDLIBS += -ldbfp -L. +dbfp_check: dbfp_check.o + +dbfp.o: dbfp.c dbfp.h + +dbfp_check.o: CFLAGS += $(CHECK_CFLAGS) +dbfp_check.o: dbfp_check.c dbfp.h dbfp.c |