summaryrefslogtreecommitdiffhomepage
path: root/tests/Makefile
blob: 5903b52536603c2de3ee4fbdf78393b17744274c (plain)
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
46
47
48
include ../common.mk

PROJECTNAME=test-webserver

CXXFLAGS+= -I. -fPIE

CXXTESTFLAGS=

LIBS=\
-lcommon \
-lboost_context \
-lboost_filesystem \
-lboost_timer \
-lboost_system \
-lcrypt \
-lpthread \
-lssl -lcrypto \
-ldl

LDFLAGS+=-pie -L../libcommon

TESTSRC=\
    test-environment.cpp \
    test-webserver.cpp \
    $(PROGSRC)

build: $(PROJECTNAME)
	./$(PROJECTNAME)

$(PROJECTNAME): ../libcommon/libcommon.a $(TESTSRC:.cpp=.o)
	$(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@

dep: $(TESTSRC:.cpp=.d)

%.d: %.cpp
	$(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -MM -MP -MF $@ -c $<

%.o: %.cpp %.d
	$(CXX) $(CXXFLAGS) $(CXXTESTFLAGS) -c $< -o $@

# misc ---------------------------------------------------

clean:
	-rm -f *.o *.a *.d $(PROJECTNAME)

.PHONY: clean all install

-include $(wildcard $(TESTSRC:.cpp=.d))