]> git.stg.codes - stg.git/blob - tests/Makefile
Merge branch 'master' of madf.dyndns.org:/var/git/stg
[stg.git] / tests / Makefile
1 CXXFLAGS+=-g3 -Wall -W -Wextra -DLINUX -I../include -I../projects/stargazer -I../stglibs/conffiles.lib -I.
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         ../projects/stargazer/tariff.cpp \
11         ../stglibs/conffiles.lib/conffiles.cpp
12
13 all: $(PROG) 
14
15 $(PROG): $(subst .cpp,.o,$(SOURCES))
16         $(CXX) $(LDFLAGS) $^ $(LIBS) -o $@
17
18 clean:
19         rm -f *.o *.d $(PROG)
20
21 ifneq ($(MAKECMDGOALS),distclean)
22 ifneq ($(MAKECMDGOALS),clean)
23 -include $(subst .cpp,.d,$(SOURCES))
24 endif
25 endif
26
27 %.d: %.cpp
28         @$(CC) -MM $(CXXFLAGS) $< > $@.$$$$; \
29         sed 's,\($*\).o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
30         rm -f $@.$$$$