-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (32 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
SHARED_OBJS = utils/buffer.o utils/parser.o utils/commander.o
LIBS = -lexpat
COMMANDER_DIR = ../clib/deps/commander
INCLUDES = -I $(COMMANDER_DIR) -I .
CFLAGS = -Wall -Wextra $(INCLUDES) $(MYCFLAGS)
ifdef debug
CFLAGS += -g -fsanitize=address -fno-omit-frame-pointer
else
CFLAGS += -O3
endif
COMPILE = $(CC) $(CFLAGS)
LUA_LIBS = -llua -ldl -lm
# Change this to the path of the latest pages-meta-current.xml
# from the Wiktionary dump.
PAGES_XML = pages.xml
.SECONDARY:
.SECONDEXPANSION:
# all-headers, filter-headers
%-headers: $(SHARED_OBJS) src/[email protected] utils/get_header.o
$(COMPILE) $(SHARED_OBJS) src/[email protected] utils/get_header.o \
-o bin/$@ $(LIBS) -lhat-trie
find-templates: $(SHARED_OBJS) src/[email protected]
$(COMPILE) $(SHARED_OBJS) src/[email protected] \
-o bin/$@ $(LIBS)
find-multiple-templates: $(SHARED_OBJS) src/[email protected]
$(COMPILE) $(SHARED_OBJS) src/[email protected] \
-o bin/$@ $(LIBS) -lhat-trie
process-with-lua: $(SHARED_OBJS) src/[email protected]
$(COMPILE) $(SHARED_OBJS) src/[email protected] \
-o bin/$@ $(LIBS) $(LUA_LIBS) -export-dynamic
utils/commander.o: $(COMMANDER_DIR)/commander.c
$(COMPILE) -c $(COMMANDER_DIR)/commander.c -o $@