|
@@ -84,43 +84,53 @@ lib: $(DEPLIBS) $(LIBS) ## Compile main library (static and dynamic linking).
|
|
|
|
|
|
debug: $(DEPLIBS) $(DBG_LIBS) ## Compile main library with debug symbols.
|
|
debug: $(DEPLIBS) $(DBG_LIBS) ## Compile main library with debug symbols.
|
|
|
|
|
|
|
|
+
|
|
# Static library.
|
|
# Static library.
|
|
liblsuprdf.a: $(OBJ)
|
|
liblsuprdf.a: $(OBJ)
|
|
$(AR) rs $@ $^
|
|
$(AR) rs $@ $^
|
|
|
|
|
|
|
|
+
|
|
# Dynamic library.
|
|
# Dynamic library.
|
|
liblsuprdf.so: $(OBJ)
|
|
liblsuprdf.so: $(OBJ)
|
|
$(CC) -shared $(LDFLAGS) -o $@ $^
|
|
$(CC) -shared $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
+
|
|
# Static debug library.
|
|
# Static debug library.
|
|
liblsuprdf_dbg.a: $(DBG_OBJ)
|
|
liblsuprdf_dbg.a: $(DBG_OBJ)
|
|
$(AR) rs $@ $^
|
|
$(AR) rs $@ $^
|
|
|
|
|
|
|
|
+
|
|
# Dynamic debug library.
|
|
# Dynamic debug library.
|
|
liblsuprdf_dbg.so: $(DBG_OBJ)
|
|
liblsuprdf_dbg.so: $(DBG_OBJ)
|
|
$(CC) -shared $(LDFLAGS) -o $@ $^
|
|
$(CC) -shared $(LDFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
+
|
|
# Debug objects.
|
|
# Debug objects.
|
|
%_dbg.o: %.c
|
|
%_dbg.o: %.c
|
|
$(CC) $(CFLAGS) $(DBG_CFLAGS) $(LDFLAGS) -c $^ -o $@
|
|
$(CC) $(CFLAGS) $(DBG_CFLAGS) $(LDFLAGS) -c $^ -o $@
|
|
|
|
|
|
|
|
+
|
|
# Codecs.
|
|
# Codecs.
|
|
$(CODEC_OBJ): $(CODEC_SRC)
|
|
$(CODEC_OBJ): $(CODEC_SRC)
|
|
|
|
|
|
|
|
+
|
|
# Parser C sources.
|
|
# Parser C sources.
|
|
%_parser.c: %_lexer.re %_grammar.c
|
|
%_parser.c: %_lexer.re %_grammar.c
|
|
$(LEXER) $< -o $@ -T --case-ranges
|
|
$(LEXER) $< -o $@ -T --case-ranges
|
|
|
|
|
|
|
|
+
|
|
# Parser generators.
|
|
# Parser generators.
|
|
%_grammar.c: %_grammar.y
|
|
%_grammar.c: %_grammar.y
|
|
$(PARSER) $< -q -m -T$(CODEC_DIR)/lempar.c -d$(CODEC_DIR)
|
|
$(PARSER) $< -q -m -T$(CODEC_DIR)/lempar.c -d$(CODEC_DIR)
|
|
|
|
|
|
|
|
+
|
|
# Ext libraries.
|
|
# Ext libraries.
|
|
|
|
|
|
.PHONY: libxxhash
|
|
.PHONY: libxxhash
|
|
libxxhash:
|
|
libxxhash:
|
|
$(MAKE) -C $(XXHASH_DIR)
|
|
$(MAKE) -C $(XXHASH_DIR)
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
.PHONY: liblmdb
|
|
.PHONY: liblmdb
|
|
liblmdb:
|
|
liblmdb:
|
|
$(MAKE) -C $(MDB_DIR)
|
|
$(MAKE) -C $(MDB_DIR)
|
|
@@ -156,6 +166,7 @@ uninstall:
|
|
rm -rf $(DESTDIR)$(includedir)
|
|
rm -rf $(DESTDIR)$(includedir)
|
|
rm -f bin/test*
|
|
rm -f bin/test*
|
|
|
|
|
|
|
|
+
|
|
# For testing, use debug symbols.
|
|
# For testing, use debug symbols.
|
|
bin/test: debug $(TEST_SRC)
|
|
bin/test: debug $(TEST_SRC)
|
|
$(CC) $(CFLAGS) $(DBG_CFLAGS) -Itest $(LDFLAGS) -llsuprdf_dbg \
|
|
$(CC) $(CFLAGS) $(DBG_CFLAGS) -Itest $(LDFLAGS) -llsuprdf_dbg \
|
|
@@ -173,6 +184,7 @@ gdb_test: bin/test ## Run a test suite within gdb.
|
|
@echo "Using libraries: "; ldd bin/test
|
|
@echo "Using libraries: "; ldd bin/test
|
|
exec gdb bin/test
|
|
exec gdb bin/test
|
|
|
|
|
|
|
|
+
|
|
lint:
|
|
lint:
|
|
splint \
|
|
splint \
|
|
$(INCLUDE) -Itest \
|
|
$(INCLUDE) -Itest \
|
|
@@ -188,7 +200,7 @@ memcheck:
|
|
--leak-check=full --show-leak-kinds=all --track-origins=yes \
|
|
--leak-check=full --show-leak-kinds=all --track-origins=yes \
|
|
--log-file=$(VALGRIND_DUMP) \
|
|
--log-file=$(VALGRIND_DUMP) \
|
|
./bin/test
|
|
./bin/test
|
|
- echo "Memcheck complete. Valgrind log is at $(VALGRIND_DUMP)"
|
|
|
|
|
|
+ @echo "Memcheck complete. Valgrind log is at $(VALGRIND_DUMP)"
|
|
|
|
|
|
|
|
|
|
memtest: bin/test memcheck ## Run a test suite using Valgrind. Output to separate file.
|
|
memtest: bin/test memcheck ## Run a test suite using Valgrind. Output to separate file.
|
|
@@ -223,7 +235,6 @@ pytest: ## Run a test suite for the Python package.
|
|
python3 test/cpython_test.py
|
|
python3 test/cpython_test.py
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
# Requires cinclude2dot (https://www.flourish.org/cinclude2dot) and Graphviz.
|
|
# Requires cinclude2dot (https://www.flourish.org/cinclude2dot) and Graphviz.
|
|
depgraph: src/* include/* ## Build a visual dependency graph of the code.
|
|
depgraph: src/* include/* ## Build a visual dependency graph of the code.
|
|
cinclude2dot --merge=module --include=$(DEPS) \
|
|
cinclude2dot --merge=module --include=$(DEPS) \
|