From 0cdf6f17b06acd2f0be3b09634db2a33cc85d37f Mon Sep 17 00:00:00 2001 From: Aljar Meesters Date: Thu, 24 Mar 2016 17:29:54 +0100 Subject: [PATCH] added dependencies to makefile --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9698d4c..2db507f 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,7 @@ LINKER = g++ # with a list of all flags that should be passed to the linker. # -COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -fpic -DVERSION="`./version.sh`" -I. -g +COMPILER_FLAGS = -Wall -c -O2 -std=c++11 -MD -fpic -DVERSION="`./version.sh`" -I. -g LINKER_FLAGS = -shared LINKER_DEPENDENCIES = -lphpcpp -lyothalot -lamqpcpp @@ -115,6 +115,7 @@ MKDIR = mkdir -p SOURCES = $(wildcard *.cpp) $(wildcard json/*.cpp) OBJECTS = $(SOURCES:%.cpp=%.o) +DEPENDENCIES = $(OBJECTS:%.o=%.d) # # From here the build instructions start @@ -122,6 +123,8 @@ OBJECTS = $(SOURCES:%.cpp=%.o) all: ${OBJECTS} ${EXTENSION} +-include $(DEPENDENCIES) + ${EXTENSION}: ${OBJECTS} ${LINKER} ${LINKER_FLAGS} -o $@ ${OBJECTS} ${LINKER_DEPENDENCIES}