From d69e69adb689de91f97bc184c9ebc1022d0e4fc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Z=C3=BCger?= Date: Thu, 21 Dec 2023 00:23:50 +0100 Subject: [PATCH] py/mkrules.mk: Fix dependency file generation for compiler wrappers. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compiling with distcc, it does not understand the -MD flag on its own. This fixes the interaction by explicitly adding the -MF option. The error in distcc is described here under "Problems with gcc -MD": https://www.distcc.org/faq.html Signed-off-by: Peter Züger --- py/mkrules.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/py/mkrules.mk b/py/mkrules.mk index 7ecb2a5f6..30483feb5 100644 --- a/py/mkrules.mk +++ b/py/mkrules.mk @@ -63,7 +63,7 @@ $(BUILD)/%.o: %.s define compile_c $(ECHO) "CC $<" -$(Q)$(CC) $(CFLAGS) -c -MD -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false) +$(Q)$(CC) $(CFLAGS) -c -MD -MF $(@:.o=.d) -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false) @# The following fixes the dependency file. @# See http://make.paulandlesley.org/autodep.html for details. @# Regex adjusted from the above to play better with Windows paths, etc. @@ -75,7 +75,7 @@ endef define compile_cxx $(ECHO) "CXX $<" -$(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false) +$(Q)$(CXX) $(CXXFLAGS) -c -MD -MF $(@:.o=.d) -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false) @# The following fixes the dependency file. @# See http://make.paulandlesley.org/autodep.html for details. @# Regex adjusted from the above to play better with Windows paths, etc.