]> git.stg.codes - stg.git/blob - tests/Makefile
Ticket 37. Default value for the change_policy_timeout changed to 0 in
[stg.git] / tests / Makefile
1 INCS = -I . \
2        -I ../include \
3        -I ../stglibs/common.lib/include \
4        -I ../stglibs/conffiles.lib/include \
5        -I ../stglibs/logger.lib/include \
6        -I ../stglibs/scriptexecuter.lib/include \
7        -I ../stglibs/crypto.lib/include \
8        -I ../projects/stargazer
9 DEFS = -DLINUX \
10        -DUSE_ABSTRACT_SETTINGS
11 CFLAGS += -g3 -Wall -W -Wextra -Wno-unused-function $(INCS) $(DEFS)
12 CXXFLAGS += $(CFLAGS)
13 LIBS = -lpthread
14 PROG = tests
15
16 SOURCES = main.cpp \
17           test_raw_ip.cpp \
18           test_admin_conf.cpp \
19           test_tariff.cpp \
20           test_conffiles.cpp \
21           test_fee_charge_rules.cpp \
22           test_reconnect_on_tariff_change.cpp \
23           test_disable_session_log.cpp \
24           test_filter_params_log.cpp \
25           test_crypto.cpp \
26           test_bfstream.cpp \
27           ../projects/stargazer/tariff_impl.cpp \
28           ../projects/stargazer/user_impl.cpp \
29           ../projects/stargazer/user_property.cpp \
30           ../stglibs/conffiles.lib/conffiles.cpp \
31           ../stglibs/common.lib/common.cpp \
32           ../stglibs/logger.lib/logger.cpp \
33           ../stglibs/scriptexecuter.lib/scriptexecuter.cpp \
34           ../stglibs/crypto.lib/bfstream.cpp \
35           ../stglibs/crypto.lib/blowfish.c
36
37 .PHONY: all clean
38
39 all: $(PROG)
40
41 $(PROG): $(addsuffix .o,$(basename $(SOURCES)))
42         $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
43
44 clean:
45         rm -f $(addsuffix .o,$(basename $(SOURCES))) $(addsuffix .d,$(SOURCES)) $(PROG)
46
47 ifneq ($(MAKECMDGOALS),distclean)
48 ifneq ($(MAKECMDGOALS),clean)
49 -include $(addsuffix .d,$(SOURCES))
50 endif
51 endif
52
53 %.cpp.d: %.cpp
54         @$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
55         sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
56         rm -f $@.$$$$
57
58 %.c.d: %.c
59         @$(CC) -MM $(CFLAGS) $< > $@.$$$$; \
60         sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
61         rm -f $@.$$$$