From dc845841f0f201d42c87b10da5faa8ba55ba113c Mon Sep 17 00:00:00 2001 From: Leandro Lanzieri Date: Thu, 28 Nov 2019 15:34:20 +0100 Subject: [PATCH] Makefile.base: Set targets of *.d files to absolute object path By passing the -MT flag with the absolute path to the object we make sure that the compiler generates dependency files with rules that match our building rules. --- Makefile.base | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.base b/Makefile.base index f937603245..5f7fd9f02d 100644 --- a/Makefile.base +++ b/Makefile.base @@ -100,25 +100,25 @@ $(OBJC): $(BINDIR)/$(MODULE)/%.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) $(Q)$(CCACHE) $(CC) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \ -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ - $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) + $(CFLAGS) $(INCLUDES) -MQ '$@' -MD -MP -c -o $@ $(abspath $<) $(GENOBJC): %.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) $(Q) $(CCACHE) $(CC) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$<)\" \ -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ - $(CFLAGS) $(INCLUDES) -MD -MP -c -o $@ $< + $(CFLAGS) $(INCLUDES) -MQ '$@' -MD -MP -c -o $@ $< $(OBJCXX): $(BINDIR)/$(MODULE)/%.o: %.cpp $(RIOTBUILD_CONFIG_HEADER_C) $(Q)$(CCACHE) $(CXX) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \ -DRIOT_FILE_NOPATH=\"$(notdir $<)\" \ - $(CXXFLAGS) $(CXXINCLUDES) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) + $(CXXFLAGS) $(CXXINCLUDES) $(INCLUDES) -MQ '$@' -MD -MP -c -o $@ $(abspath $<) $(ASMOBJ): $(BINDIR)/$(MODULE)/%.o: %.s $(Q)$(AS) $(ASFLAGS) -o $@ $(abspath $<) $(ASSMOBJ): $(BINDIR)/$(MODULE)/%.o: %.S $(RIOTBUILD_CONFIG_HEADER_C) - $(Q)$(CCAS) $(CCASFLAGS) $(INCLUDES) -MD -MP -c -o $@ $(abspath $<) + $(Q)$(CCAS) $(CCASFLAGS) $(INCLUDES) -MQ '$@' -MD -MP -c -o $@ $(abspath $<) # pull in dependency info for *existing* .o files # deleted header files will be silently ignored