forked from dirkm/asn1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 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
42
43
44
45
OBJS:= syntax/generate_static_lex.o
TEST_OBJS:=test/syntax.o test/read_from_file.o test/codec.o test/parse_experiments.o
ALL_OBJS:=$(OBJS) $(TEST_OBJS)
BOOST_INC:=/home/dirk/localbuild/boost-trunk
#BOOST_LIB:=/home/dirk/local/lib
#EXTRAFLAGS:= -O2 -g
EXTRAFLAGS:= -g
#derived variables
INCLUDES:=-I$(BOOST_INC) -I.
CPPFLAGS:=$(INCLUDES) $(EXTRAFLAGS)
all: test/syntax test/codec test/parse_experiments
clean:
rm -f $(ALL_OBJS) $(ALL_OBJS:.o=.d) $(PROGRAMS) syntax/lex_static.hpp
syntax/generate_static_lex: syntax/generate_static_lex.o
${CXX} $^ -o $@
test/syntax: test/read_from_file.o test/syntax.o
${CXX} $^ -o $@
test/codec: test/codec.o
${CXX} $^ -o $@
test/parse_experiments: test/parse_experiments.o
${CXX} $^ -o $@
syntax/lex_static.hpp: syntax/generate_static_lex
./$^ $@
#explicit because lex_static might not exist
test/syntax.d test/read_from_file.d syntax/lex.d: syntax/lex_static.hpp
%.d: %.cpp
$(CXX) -MM $(CPPFLAGS) $< > $@.$$$$ && \
sed 's,$(*F)\.o[ :]*,$(@:.d=.o) $@ : ,g' < $@.$$$$ > $@ && \
rm -f $@.$$$$
ifneq ($(MAKECMDGOALS),clean)
sinclude $(ALL_OBJS:.o=.d)
endif