|
@@ -9,34 +9,36 @@ AR = ar
|
|
|
## Paths.
|
|
|
|
|
|
PREFIX ?= /usr/local
|
|
|
-bindir ::= $(PREFIX)/bin
|
|
|
-libdir ::= $(PREFIX)/lib
|
|
|
+bindir = $(PREFIX)/bin
|
|
|
+libdir = $(PREFIX)/lib
|
|
|
includedir = $(PREFIX)/include/lsup
|
|
|
outdir = ./bin
|
|
|
VALGRIND_DUMP = /tmp/lsup_valgrind.log
|
|
|
CALLGRIND_DUMP = /tmp/lsup_callgrind.out
|
|
|
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 -MMD $(INCLUDE)
|
|
|
+INCLUDE_BASE = . -Iinclude -Iext/tpl/src -Iext/hashmap -Iext/log/src
|
|
|
+INCLUDE = -I$(INCLUDE_BASE)
|
|
|
+_CFLAGS = -std=gnu11 -Wall -fPIC -MMD $(INCLUDE)
|
|
|
CFLAGS = $(_CFLAGS) -O3
|
|
|
DBG_CFLAGS = $(_CFLAGS) -Itest -O0 -g3 -DDEBUG
|
|
|
+#$(info CFLAGS: $(CFLAGS))
|
|
|
+#$(info DBG_CFLAGS: $(DBG_CFLAGS))
|
|
|
# NOTE: -luuid is a Linux system library. Other OS's might need a different
|
|
|
# link or a non-system library built.
|
|
|
-LDFLAGS ::= -L. -L$(outdir) -L$(libdir) -llmdb -lxxhash -luuid
|
|
|
+LDFLAGS = -L. -L$(outdir) -L$(libdir) -llmdb -lxxhash -luuid
|
|
|
|
|
|
PARSER = bin/lemon
|
|
|
LEMON_SRC = ext/sqlite/tool/lemon.c
|
|
|
CODEC_DIR = src/codec
|
|
|
|
|
|
# External sources compiled in core object.
|
|
|
-EXT_SRC ::= $(wildcard ext/log/src/*.c) \
|
|
|
+EXT_SRC = $(wildcard ext/log/src/*.c) \
|
|
|
$(wildcard ext/hashmap/*.c) \
|
|
|
$(wildcard ext/tpl/src/*.c)
|
|
|
|
|
|
# External headers of libraries compiled in core.
|
|
|
-EXT_H ::= $(wildcard ext/log/src/*.h) \
|
|
|
+EXT_H = $(wildcard ext/log/src/*.h) \
|
|
|
$(wildcard ext/tpl/src/*.h) \
|
|
|
$(wildcard ext/hashmap/*.h)
|
|
|
|
|
@@ -44,11 +46,12 @@ LSUP_SRC = $(wildcard src/*.c)
|
|
|
SRC = $(EXT_SRC) $(LSUP_SRC)
|
|
|
TEST_SRC = $(wildcard test/*.c) test.c
|
|
|
|
|
|
-EXT_OBJ ::= $(EXT_SRC:.c=.o)
|
|
|
+EXT_OBJ = $(EXT_SRC:.c=.o)
|
|
|
# TODO This is extremely convoluted, simplify if possible.
|
|
|
CODEC_SRC ::= $(wildcard $(CODEC_DIR)/codec_*.c)
|
|
|
CODEC_REL_SRC ::= $(CODEC_SRC:$(CODEC_DIR)/%=%)
|
|
|
-ALL_CODEC_REL_SRC ::= $(CODEC_REL_SRC) $(CODEC_REL_SRC:codec_%=parser_%) \
|
|
|
+$(info CODEC_SRC: $(CODEC_SRC))
|
|
|
+ALL_CODEC_REL_SRC = $(CODEC_REL_SRC) $(CODEC_REL_SRC:codec_%=parser_%) \
|
|
|
$(CODEC_REL_SRC:codec_%=grammar_%)
|
|
|
CODEC_SRC = $(ALL_CODEC_REL_SRC:%=$(CODEC_DIR)/%)
|
|
|
CODEC_OBJ = $(CODEC_SRC:.c=.o)
|