Makefile 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. CC=gcc
  2. CFLAGS+= -Wall -std=c11 -D_XOPEN_SOURCE=500
  3. INCLUDE=-Iinclude -Iext/xxHash -Iext/openldap/libraries/liblmdb -Iext/uthash/src
  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. test_lexer:
  31. re2c src/codec/nt.re -o src/codec/nt.c -T --case-ranges && \
  32. $(CC) \
  33. $(CFLAGS) -g3 -DDEBUG \
  34. $(INCLUDE) -I. \
  35. $(LIB) \
  36. $(SRC) src/codec/nt.c \
  37. -o bin/test_lexer
  38. valgrind:
  39. valgrind \
  40. --leak-check=full --show-leak-kinds=all --track-origins=yes \
  41. ./bin/test
  42. memcheck: test valgrind
  43. profile:
  44. $(CC) \
  45. $(CFLAGS) \
  46. $(INCLUDE) \
  47. $(LIB) \
  48. $(SRC) profile.c \
  49. -o bin/profile