]> git.stg.codes - stg.git/blob - tests/Makefile
Add new unit test - checking fee charging rules
[stg.git] / tests / Makefile
1 CXXFLAGS+=-g3 -Wall -W -Wextra -DLINUX -I../include -I../projects/stargazer -I../stglibs/stgconffiles.lib -I. -DUSE_ABSTRACT_SETTINGS
2 LIBS=-lpthread
3 PROG=tests
4
5 SOURCES=main.cpp \
6         test_raw_ip.cpp \
7         test_admin_conf.cpp \
8         test_tariff.cpp \
9         test_conffiles.cpp \
10         test_fee_charge_rules.cpp \
11         ../projects/stargazer/tariff_impl.cpp \
12         ../projects/stargazer/user_impl.cpp \
13         ../projects/stargazer/user_property.cpp \
14         ../stglibs/conffiles.lib/conffiles.cpp \
15         ../stglibs/common.lib/common.cpp \
16         ../stglibs/logger.lib/logger.cpp \
17         ../stglibs/scriptexecuter.lib/scriptexecuter.cpp
18
19 .PHONY: all includes clean
20
21 all: includes $(PROG)
22
23 includes:
24         make -C ../stglibs includes
25
26 $(PROG): $(subst .cpp,.o,$(SOURCES))
27         $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
28
29 clean:
30         rm -f *.o *.d $(PROG)
31
32 ifneq ($(MAKECMDGOALS),distclean)
33 ifneq ($(MAKECMDGOALS),clean)
34 -include $(subst .cpp,.d,$(SOURCES))
35 endif
36 endif
37
38 %.d: %.cpp
39         @$(CC) -MM $(CXXFLAGS) $< > $@.$$$$; \
40         sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
41         rm -f $@.$$$$