Skip to content

Commit 3ba0e88

Browse files
committed
Update Makefile to compile debug target for http-parser in case of 'make debug'.
1 parent 118aea8 commit 3ba0e88

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Makefile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,37 @@ INCDEPS= include/segtree.hpp include/sparsetable.hpp include/benderrmq.hp
55
include/phrase_map.hpp include/suggest.hpp include/types.hpp \
66
include/utils.hpp include/httpserver.hpp
77
INCDIRS= -I . -I deps
8-
OBJDEPS= src/httpserver.o deps/libuv/libuv.a deps/http-parser/http_parser.o
8+
OBJDEPS= src/httpserver.o deps/libuv/libuv.a
99

10-
all: CFLAGS += -O2 -DNDEBUG
10+
ifeq "$(findstring debug,$(MAKECMDGOALS))" ""
11+
OBJDEPS += deps/http-parser/http_parser.o
12+
else
13+
OBJDEPS += deps/http-parser/http_parser_g.o
14+
endif
15+
16+
.PHONY: all clean debug test perf
17+
18+
all: CFLAGS += -O2 -DNDEBUG
1119
all: CXXFLAGS += -O2 -DNDEBUG
1220
all: targets
1321

14-
debug: CFLAGS += -g
22+
debug: CFLAGS += -g
1523
debug: CXXFLAGS += -g
1624
debug: targets
1725

1826
targets: lib-face
1927

2028
lib-face: src/main.cpp $(OBJDEPS) $(INCDEPS)
21-
$(CXX) -o lib-face src/main.cpp $(OBJDEPS) \
22-
$(INCDIRS) $(CXXFLAGS) $(LINKFLAGS)
29+
$(CXX) -o lib-face src/main.cpp $(OBJDEPS) $(INCDIRS) $(CXXFLAGS) $(LINKFLAGS)
2330

2431
src/httpserver.o: src/httpserver.cpp include/httpserver.hpp
2532
$(CXX) -o src/httpserver.o -c src/httpserver.cpp $(INCDIRS)
2633

2734
deps/libuv/libuv.a:
28-
$(MAKE) -C deps/libuv
35+
$(MAKE) -C deps/libuv $(HPFLAGS)
36+
37+
deps/http-parser/http_parser_g.o:
38+
$(MAKE) -C deps/http-parser http_parser_g.o
2939

3040
deps/http-parser/http_parser.o:
3141
$(MAKE) -C deps/http-parser http_parser.o

0 commit comments

Comments
 (0)