This repository was archived by the owner on Jul 16, 2020. It is now read-only.
forked from duckduckgo/cpp-libface
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (70 loc) · 2.59 KB
/
Makefile
File metadata and controls
86 lines (70 loc) · 2.59 KB
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
CXXFLAGS= -std=c++11 -Wall $(COPT) -D_FILE_OFFSET_BITS=64
LINKFLAGS= -lm -lrt -pthread
INCDEPS= include/segtree.hpp include/sparsetable.hpp include/benderrmq.hpp \
include/phrase_map.hpp include/suggest.hpp include/types.hpp \
include/utils.hpp include/httpserver.hpp include/fasttext_impl.hpp \
include/lrucache.hpp
INCDIRS= -I . -I deps -I deps/sent2vec/src
OBJDEPS= src/httpserver.o deps/libuv/libuv.a
FASTTEXTDEPS= deps/sent2vec/args.o \
deps/sent2vec/dictionary.o deps/sent2vec/productquantizer.o \
deps/sent2vec/matrix.o deps/sent2vec/qmatrix.o deps/sent2vec/vector.o \
deps/sent2vec/model.o deps/sent2vec/utils.o deps/sent2vec/fasttext.o
HTTPSERVERDEPS= src/httpserver.cpp include/httpserver.hpp include/utils.hpp \
include/types.hpp
ifeq "$(findstring debug,$(MAKECMDGOALS))" ""
OBJDEPS += deps/http-parser/http_parser.o
else
OBJDEPS += deps/http-parser/http_parser_g.o
endif
.PHONY: all clean debug test perf
all: CXXFLAGS += -O2
all: targets
debug: CXXFLAGS += -g -DDEBUG
debug: targets
test: CXXFLAGS += -g -DDEBUG
perf: CXXFLAGS += -O2
targets: lib-face
lib-face: src/main.cpp $(OBJDEPS) $(FASTTEXTDEPS) $(INCDEPS)
$(CXX) -o lib-face src/main.cpp $(OBJDEPS) $(FASTTEXTDEPS) $(INCDIRS) $(CXXFLAGS) $(LINKFLAGS)
src/httpserver.o: $(HTTPSERVERDEPS)
$(CXX) -o src/httpserver.o -c src/httpserver.cpp $(INCDIRS) $(CXXFLAGS)
deps/libuv/libuv.a:
$(MAKE) -C deps/libuv
deps/http-parser/http_parser_g.o:
$(MAKE) -C deps/http-parser http_parser_g.o
deps/http-parser/http_parser.o:
$(MAKE) -C deps/http-parser http_parser.o
# BUILD fasttext dependencies start
deps/sent2vec/fasttext.o:
$(MAKE) -C deps/sent2vec fasttext.o
deps/sent2vec/args.o:
$(MAKE) -C deps/sent2vec args.o
deps/sent2vec/dictionary.o:
$(MAKE) -C deps/sent2vec dictionary.o
deps/sent2vec/productquantizer.o:
$(MAKE) -C deps/sent2vec productquantizer.o
deps/sent2vec/matrix.o:
$(MAKE) -C deps/sent2vec matrix.o
deps/sent2vec/qmatrix.o:
$(MAKE) -C deps/sent2vec qmatrix.o
deps/sent2vec/vector.o:
$(MAKE) -C deps/sent2vec vector.o
deps/sent2vec/model.o:
$(MAKE) -C deps/sent2vec model.o
deps/sent2vec/utils.o:
$(MAKE) -C deps/sent2vec utils.o
deps/sent2vec/fasttext.o:
$(MAKE) -C deps/sent2vec fasttext.o
# BUILD fasttext dependencies end
test:
$(CXX) -o tests/containers tests/containers.cpp -I . $(CXXFLAGS)
tests/containers
perf:
$(CXX) -o tests/rmq_perf tests/rmq_perf.cpp -I . $(CXXFLAGS)
tests/rmq_perf
clean:
$(MAKE) -C deps/libuv clean
$(MAKE) -C deps/http-parser clean
$(MAKE) -C deps/sent2vec clean
rm -f lib-face tests/containers tests/rmq_perf src/httpserver.o