|
@@ -23,8 +23,8 @@ MASSIF_DUMP = /tmp/lsup_massif.out
|
|
|
INCLUDE_BASE := . -Iinclude -Iext/tpl/src -Iext/hashmap -Iext/log/src
|
|
|
INCLUDE := -I$(INCLUDE_BASE)
|
|
|
_CFLAGS := -std=gnu11 -Wall -fPIC $(INCLUDE)
|
|
|
-CFLAGS = $(_CFLAGS) -O3
|
|
|
-DBG_CFLAGS = $(_CFLAGS) -Itest -O0 -ggdb -DDEBUG
|
|
|
+DBG_CFLAGS := $(_CFLAGS) -Itest -O0 -ggdb -DDEBUG
|
|
|
+CFLAGS := $(_CFLAGS) -O3
|
|
|
#$(info CFLAGS: $(CFLAGS))
|
|
|
#$(info DBG_CFLAGS: $(DBG_CFLAGS))
|
|
|
# NOTE: -luuid is a Linux system library. Other OS's might need a different
|
|
@@ -70,6 +70,9 @@ DYN_DBG_LIB = $(DYN_LIB:.so=_dbg.so)
|
|
|
LIBS = $(STATIC_LIB) $(DYN_LIB)
|
|
|
DBG_LIBS = $(STATIC_DBG_LIB) $(DYN_DBG_LIB)
|
|
|
|
|
|
+#$(info LIBS: $(LIBS))
|
|
|
+#$(info DBG_LIBS: $(DBG_LIBS))
|
|
|
+
|
|
|
# LDD for Linux, otool -L for OSX.
|
|
|
ifeq (, $(shell which ldd))
|
|
|
LDD := otool -L
|
|
@@ -81,7 +84,6 @@ endif
|
|
|
DEPS := $(shell echo "${INCLUDE_BASE}" | sed -e 's/ -I/,/g'),include/codec
|
|
|
DOCS = docs
|
|
|
|
|
|
-
|
|
|
## Environment.
|
|
|
|
|
|
# Tests need the freshly compiled libs.
|
|
@@ -132,7 +134,7 @@ $(DYN_DBG_LIB): $(DBG_OBJ)
|
|
|
|
|
|
# Standard objects.
|
|
|
$(BUILDDIR)/%.o: src/%.c
|
|
|
- $(CC) $(DBG_CFLAGS) -c $^ -o $@
|
|
|
+ $(CC) $(CFLAGS) -c $^ -o $@
|
|
|
|
|
|
|
|
|
# Debug objects.
|
|
@@ -244,10 +246,18 @@ perftest: bin/perftest ## Run a performance test by creating, inserting and look
|
|
|
|
|
|
|
|
|
.PHONY: profile
|
|
|
-profile: bin/profile ## Run a profiling session. Output can be inspected with KCachegrind.
|
|
|
+profile: bin/profile ## Run a profiling session on a limited set of high-volume commands.
|
|
|
LSUP_MDB_MAPSIZE=800000 valgrind --tool=callgrind \
|
|
|
--callgrind-out-file="$(CALLGRIND_DUMP)" bin/profile 1000
|
|
|
- @echo "Profile dump written at $(CALLGRIND_DUMP). Open it with "\
|
|
|
+ @echo "Profile dump written at $(CALLGRIND_DUMP) . Open it with "\
|
|
|
+ "qcachegrind, kcachegrind, etc."
|
|
|
+
|
|
|
+
|
|
|
+.PHONY: test_profile
|
|
|
+test_profile: bin/test ## Run profiling on the standard test suite.
|
|
|
+ LSUP_MDB_MAPSIZE=800000 valgrind --tool=callgrind \
|
|
|
+ --callgrind-out-file="$(CALLGRIND_DUMP)" bin/test
|
|
|
+ @echo "Profile dump written at $(CALLGRIND_DUMP) . Open it with "\
|
|
|
"qcachegrind, kcachegrind, etc."
|
|
|
|
|
|
|
|
@@ -260,7 +270,7 @@ footprint: bin/perftest ## Measure memory footprint by generating and storing 10
|
|
|
|
|
|
|
|
|
# Requires cinclude2dot (https://www.flourish.org/cinclude2dot) and Graphviz.
|
|
|
-depgraph: $(LSUP_SRC) $(CODEC_SRC) include/* include/codec/* ## Build a visual dependency graph of the code.
|
|
|
+depgraph: $(LSUP_SRC) include/* include/lsup/* include/lsup/codec/* ## Build a visual dependency graph of the code.
|
|
|
cinclude2dot --merge=module --include=$(DEPS) \
|
|
|
--exclude='test|ext' >| $(DOCS)/dev/deps.dot
|
|
|
dot $(DOCS)/dev/deps.dot -Tpdf >| $(DOCS)/dev/deps.pdf
|