Makefile 824 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. CC=gcc
  2. CFLAGS+= -Wall -std=c99 -D_XOPEN_SOURCE=500
  3. INCLUDE=-Iinclude -Iext/xxHash -Iext/openldap/libraries/liblmdb
  4. LIB=-luuid -lpthread
  5. SRC=ext/xxHash/xxhash.c ext/openldap/libraries/liblmdb/mdb.c \
  6. ext/openldap/libraries/liblmdb/midl.c src/*.c
  7. .PHONY: build test lint profile
  8. default: test
  9. build:
  10. $(CC) \
  11. $(CFLAGS) -Werror
  12. $(INCLUDE) \
  13. $(LIB) \
  14. $(SRC) \
  15. -o bin/lsup_rdf.so
  16. lint:
  17. splint \
  18. $(INCLUDE) -Itest \
  19. -DUINT_MAX=0xFFFFFFFFUL \
  20. -nullpass \
  21. -posix-lib \
  22. test.c
  23. test:
  24. $(CC) \
  25. $(CFLAGS) -g3 -DDEBUG \
  26. $(INCLUDE) -Itest \
  27. $(LIB) \
  28. $(SRC) test.c \
  29. -o bin/test
  30. valgrind:
  31. valgrind \
  32. --leak-check=full --show-leak-kinds=all --track-origins=yes \
  33. ./bin/test
  34. memcheck: test valgrind
  35. profile:
  36. $(CC) \
  37. $(CFLAGS) \
  38. $(INCLUDE) \
  39. $(LIB) \
  40. $(SRC) profile.c \
  41. -o bin/profile