diff --git a/Release/src/Makefile b/Release/src/Makefile index be5dc5797a..c12c670321 100644 --- a/Release/src/Makefile +++ b/Release/src/Makefile @@ -66,6 +66,7 @@ PCH = ./pch/stdafx.h PRECOMPILED_HEADERS = $(addsuffix .gch, $(PCH)) OBJECTS = $(addsuffix .$(MODE).o, $(basename $(SOURCES))) +CPP_DEPENDENCIES = $(addsuffix .d, $(basename $(SOURCES))) # flags for the C++ compiler @@ -90,9 +91,11 @@ all: $(LIBRARY_DST) @echo "Building precompiled header $(@)" @$(CXX) -x c++-header $(CXXFLAGS) -c $< -o $@ +-include $(CPP_DEPENDENCIES) + %.$(MODE).o: %.cpp @echo "Compiling $< -> $@" - @$(CXX) $(CXXFLAGS) -c $< -o $@ + @$(CXX) -MMD -MF $*.d $(CXXFLAGS) -c $< -o $@ $(PRECOMPILED_HEADERS): $(HEADERS) diff --git a/Release/tests/Functional/http/client/Makefile b/Release/tests/Functional/http/client/Makefile index 480535ee01..d823fca4e1 100644 --- a/Release/tests/Functional/http/client/Makefile +++ b/Release/tests/Functional/http/client/Makefile @@ -37,6 +37,8 @@ $(OUTPUT_DIR)/httpclient_test.so: $(OBJECTS) @echo "Building library $@" @$(CXX) -fPIC -shared $(CXXFLAGS) $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) $^ $(LDLIBS) -o $@ +-include *.$(MODE).d + $(OBJECTS): %.$(MODE).o: %.cpp @echo "Compiling $< -> $@" - @$(CXX) -fPIC $(CXXFLAGS) -c $< -o $@ \ No newline at end of file + @$(CXX) -fPIC $(CXXFLAGS) -MMD -MF $*.$(MODE).d -c $< -o $@ \ No newline at end of file diff --git a/Release/tests/Functional/http/listener/Makefile b/Release/tests/Functional/http/listener/Makefile index 6250fa7167..f9f30b9b62 100644 --- a/Release/tests/Functional/http/listener/Makefile +++ b/Release/tests/Functional/http/listener/Makefile @@ -27,6 +27,8 @@ $(OUTPUT_DIR)/httplistener_test.so: $(OBJECTS) @echo "Building library $@" @$(CXX) -fPIC -shared $(CXXFLAGS) $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) $^ $(LDLIBS) -o $@ +-include *.$(MODE).d + $(OBJECTS): %.$(MODE).o: %.cpp @echo "Compiling $< -> $@" - @$(CXX) -fPIC $(CXXFLAGS) -c $< -o $@ \ No newline at end of file + @$(CXX) -fPIC $(CXXFLAGS) -MMD -MF $*.$(MODE).d -c $< -o $@ \ No newline at end of file diff --git a/Release/tests/Functional/http/utilities/Makefile b/Release/tests/Functional/http/utilities/Makefile index b1bc55c508..6fa79de005 100644 --- a/Release/tests/Functional/http/utilities/Makefile +++ b/Release/tests/Functional/http/utilities/Makefile @@ -4,9 +4,13 @@ LDLIBS=-lcasablanca -lunittestpp -lboost_system -lboost_thread -lboost_locale -l OUTPUT_DIR?=./$(MODE) -$(OUTPUT_DIR)/libhttptest_utilities.so: \ +FILENAME = $(OUTPUT_DIR)/libhttptest_utilities + +-include $(FILENAME).d + +$(FILENAME).so: \ http_asserts.cpp \ test_http_client.cpp \ test_http_server.cpp \ test_server_utilities.cpp - $(CXX) $(CXXFLAGS) -fPIC -shared $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) $^ $(LDLIBS) -o $@ + $(CXX) $(CXXFLAGS) -fPIC -shared $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) -MMD -MF $(FILENAME).d $(filter %.cpp, $^) $(LDLIBS) -o $@ \ No newline at end of file diff --git a/Release/tests/Functional/json/Makefile b/Release/tests/Functional/json/Makefile index 4f35333c48..33199ebcb6 100644 --- a/Release/tests/Functional/json/Makefile +++ b/Release/tests/Functional/json/Makefile @@ -4,7 +4,15 @@ LDLIBS=-lcasablanca -lunittestpp -lboost_system -lboost_thread -lpthread -lstdc+ OUTPUT_DIR?=./$(MODE) -$(OUTPUT_DIR)/json_test.so: construction_tests.cpp negative_parsing_tests.cpp parsing_tests.cpp to_as_and_operators_tests.cpp - $(CXX) -fPIC -shared $(CXXFLAGS) $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) $^ $(LDLIBS) -o $@ +FILENAME = $(OUTPUT_DIR)/json_test + +-include $(FILENAME).d + +$(FILENAME).so: \ + construction_tests.cpp \ + negative_parsing_tests.cpp \ + parsing_tests.cpp \ + to_as_and_operators_tests.cpp + $(CXX) -fPIC -shared $(CXXFLAGS) $(shell pkg-config libxml++-2.6 --cflags) $(LDFLAGS) -MMD -MF $(FILENAME).d $(filter %.cpp, $^) $(LDLIBS) -o $@