3 CFLAGS += -g3 -W -Wall -pedantic
4 CFLAGS += $(DEFINES) -D_BSD_SOURCE
8 SOURCES=logger.cpp lock.cpp traffcounter.cpp rules.cpp utils.cpp
9 RULES_TESTER_SOURCES=logger.cpp rules.cpp utils.cpp rules_tester.cpp
10 RULES_FINDER_TESTER_SOURCES=logger.cpp lock.cpp rules.cpp rules_finder.cpp utils.cpp rf_tester.cpp
11 TC_TESTER_SOURCES=logger.cpp rules.cpp rules_finder.cpp utils.cpp traffcounter.cpp lock.cpp tc_tester.cpp
15 .PHONY: all tests clean
20 $(PROG): $(subst .cpp,.o,$(SOURCES))
21 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $@
23 tests: rules_tester rf_tester tc_tester
25 rules_tester: $(subst .cpp,.o,$(RULES_TESTER_SOURCES))
26 $(CXX) $^ $(LDFLAGS) -o $@
28 rf_tester: $(subst .cpp,.o,$(RULES_FINDER_TESTER_SOURCES))
29 $(CXX) $^ $(LDFLAGS) -o $@
31 tc_tester: $(subst .cpp,.o,$(TC_TESTER_SOURCES))
32 $(CXX) $^ $(LDFLAGS) $(LIBS) -o $@
35 rm -f $(PROG) *.o *d rules_tester rf_tester tc_tester gmon.out
37 ifneq ($(MAKECMDGOALS),distclean)
38 ifneq ($(MAKECMDGOALS),clean)
39 ifneq ($(MAKECMDGOALS),uninstall)
40 -include $(subst .cpp,.d,$(SOURCES))
46 @$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
47 sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \