-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
92 lines (60 loc) · 1.84 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
SRCDIR = src
OBJDIR = obj
BINDIR = .
UTILSDIR = utils
HEADERDIR = include
HEADERS = $(wildcard $(HEADERDIR)/*.h) \
$(wildcard $(SRCDIR)/*.h)
CC := g++
CFLAGS := -std=c++11 -I$(HEADERDIR) -I$(SRCDIR) -I/data/tyolab/code/antelope/source
LDFLAGS := -lsqlite3 -ldl -lpthread -lz -lcurl -lantelope_core
ISRELEASE = 0
ifeq ($(REL), 1)
ISRELEASE = 1
endif
ifeq ($(RELEASE), 1)
ISRELEASE = 1
endif
ifeq ($(ISRELEASE), 1)
CFLAGS += -DRELEASE -O3
else
CFLAGS += -g
endif
SOURCES := $(wildcard $(SRCDIR)/*.cpp)
UTILS := $(wildcard $(UTILSDIR)/*.cpp)
OBJECTS := $(SOURCES:.cpp=.o)
UTILS_OBJS := $(UTILS:.cpp=.o)
#MAINS := $(UTILS:.cpp=.o)
#main = $(UTILS:.cpp=)
main = dump2sqlite
#test = test_article_insert
executables = $(main) dump2indexable dump2db import_dump merge_sqlite_db dump2template math2db merge_articles
all: $(executables)
$(main): $(OBJECTS) $(UTILSDIR)/$(main).o
$(CC) -o $@ $^ $(LDFLAGS)
dump2indexable: $(OBJECTS) $(UTILSDIR)/dump2indexable.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
dump2db: $(OBJECTS) $(UTILSDIR)/dump2db.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
import_dump: $(OBJECTS) $(UTILSDIR)/import_dump.o
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
dump2template: $(OBJECTS) $(UTILSDIR)/dump2template.o
$(CC) -o $@ $^ $(LDFLAGS)
merge_sqlite_db: $(OBJECTS) $(UTILSDIR)/merge_sqlite_db.o
$(CC) -o $@ $^ $(LDFLAGS)
merge_articles: $(OBJECTS) $(UTILSDIR)/merge_articles.o
$(CC) -o $@ $^ $(LDFLAGS)
math2db: $(OBJECTS) $(UTILSDIR)/math2db.o
$(CC) -o $@ $^ $(LDFLAGS)
#dump2indexable: dump2indexable.o
# $(CC) -o $@ $^ -lantelope_core
#
#dump2indexable.o: uitls/dump2indexable.cpp
# $(CC) $(CFLAGS) -c $< -o $@
#$(OBJECTS): $(OBJDIR)/%.o: $(SRCDIR)/%.cpp
%.o: %.cpp $(HEADERS)
$(CC) $(CFLAGS) -c $< -o $@
install: $(executables)
cp $(executables) /usr/local/bin/
clean:
\rm -rf $(OBJECTS) $(UTILS_OBJS) $(executables)