From 40e50192765c39dd15a0fb272b1c59f8fd04573d Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Thu, 22 Oct 2015 19:30:35 +0200 Subject: [PATCH] Fix makefile dependencies Signed-off-by: Sebastian Ramacher --- Makefile | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 203d0fb..9fc1fcc 100644 --- a/Makefile +++ b/Makefile @@ -101,9 +101,9 @@ ${OBJECTS}: config.mk ${PROJECT}/version.h \ ${BUILDDIR_RELEASE}/%.o: %.c $(call colorecho,CC,$<) - @mkdir -p ${DEPENDDIR}/$(dir $(abspath $@)) + @mkdir -p ${DEPENDDIR}/$(dir $@) @mkdir -p $(dir $(abspath $@)) - $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF ${DEPENDDIR}/$(abspath $@).dep + $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} -o $@ $< -MMD -MF ${DEPENDDIR}/$@.dep ${BUILDDIR_RELEASE}/${BINDIR}/${PROJECT}: ${OBJECTS} $(call colorecho,CC,$@) @@ -125,10 +125,10 @@ ${OBJECTS_DEBUG}: config.mk ${PROJECT}/version.h \ ${BUILDDIR_DEBUG}/%.o: %.c $(call colorecho,CC,$<) - @mkdir -p ${DEPENDDIR}/$(dir $(abspath $@)) + @mkdir -p ${DEPENDDIR}/$(dir $@) @mkdir -p $(dir $(abspath $@)) $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${DFLAGS} \ - -o $@ $< -MMD -MF ${DEPENDDIR}/$(abspath $@).dep + -o $@ $< -MMD -MF ${DEPENDDIR}/$@.dep ${BUILDDIR_DEBUG}/${BINDIR}/${PROJECT}: ${OBJECTS_DEBUG} $(call colorecho,CC,$@) @@ -148,10 +148,10 @@ ${OBJECTS_GCOV}: config.mk ${PROJECT}/version.h \ ${BUILDDIR_GCOV}/%.o: %.c $(call colorecho,CC,$<) - @mkdir -p ${DEPENDDIR}/$(dir $(abspath $@)) + @mkdir -p ${DEPENDDIR}/$(dir $@) @mkdir -p $(dir $(abspath $@)) $(QUIET)${CC} -c ${CPPFLAGS} ${CFLAGS} ${GCOV_CFLAGS} \ - -o $@ $< -MMD -MF ${DEPENDDIR}/$(abspath $@).dep + -o $@ $< -MMD -MF ${DEPENDDIR}/$@.dep ${BUILDDIR_GCOV}/${BINDIR}/${PROJECT}: ${OBJECTS_GCOV} $(call colorecho,CC,$@) @@ -288,7 +288,8 @@ uninstall: uninstall-headers $(QUIET)rm -f $(DESTDIR)$(APPDATAPREFIX)/$(PROJECT).appdata.xml $(MAKE) -C po uninstall --include $(wildcard ${DEPENDDIR}/*.dep) +DEPENDS = ${DEPENDDIRS:^=${DEPENDDIR}/}$(addprefix ${DEPENDDIR}/,${OBJECTS:.o=.o.dep}) +-include ${DEPENDS} .PHONY: all options clean doc debug valgrind gdb dist doc install uninstall \ test po install-headers uninstall-headers update-po install-manpages \