CODEC_DIR = src/codec CC = gcc CFLAGS += -Wall -DLOG_USE_COLOR INCLUDE = -I. -Iinclude -Iext/xxHash -Iext/openldap/libraries/liblmdb \ -Iext/uthash/src -Iext/log/src LIB = -luuid -lpthread SRC = ext/xxHash/xxhash.c ext/openldap/libraries/liblmdb/mdb.c \ ext/openldap/libraries/liblmdb/midl.c ext/log/src/log.c \ src/*.c src/codec/*_grammar.c src/codec/*_parser.c .PHONY: build_parsers lint profile default: test build: build_parsers $(CC) \ $(CFLAGS) -Werror $(INCLUDE) \ $(LIB) \ $(SRC) \ -o bin/lsup_rdf.so lint: splint \ $(INCLUDE) -Itest \ -DUINT_MAX=0xFFFFFFFFUL \ -nullpass \ -posix-lib \ test.c test: build_parsers $(CC) \ $(CFLAGS) -g3 -DDEBUG \ $(INCLUDE) -Itest \ $(LIB) \ $(SRC) test.c \ -o bin/test test_lexer: cd src/codec && \ lemon -T/usr/share/lemon/lempar.c nt_grammar.y && \ re2c nt_lexer.re -o nt_codec.c -T --case-ranges && \ cd ../../ $(CC) \ $(CFLAGS) -g3 -DDEBUG \ $(INCLUDE) -I. \ $(LIB) \ $(SRC) src/codec/nt_codec.c src/codec/nt_grammar.c \ -o bin/test_lexer valgrind: valgrind \ --leak-check=full --show-leak-kinds=all --track-origins=yes \ ./bin/test memcheck: test valgrind profile: build_parsers $(CC) \ $(CFLAGS) -g -DTESTING \ $(INCLUDE) \ $(LIB) \ $(SRC) profile.c \ -o bin/profile build_parsers:; $(MAKE) -C $(CODEC_DIR)