include ../common.mk PROJECTNAME=test-webserver CXXFLAGS+= -I. -fPIE CXXTESTFLAGS=-I../googletest/include -I../googlemock/include/ -I../googletest -I../googlemock LIBS=\ -lcommon \ -lboost_context \ -lboost_filesystem \ -lboost_timer \ -lboost_system \ -lcrypt \ -lpthread \ -lssl -lcrypto \ -ldl LDFLAGS+=-pie -L../libcommon TESTSRC=\ test-webserver.cpp \ ../googlemock/src/gmock-all.cpp \ ../googletest/src/gtest-all.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))