Skip to content

Commit d69e69a

Browse files
peterzugerdpgeorge
authored andcommitted
py/mkrules.mk: Fix dependency file generation for compiler wrappers.
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 <[email protected]>
1 parent ce42c9e commit d69e69a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

py/mkrules.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $(BUILD)/%.o: %.s
6363

6464
define compile_c
6565
$(ECHO) "CC $<"
66-
$(Q)$(CC) $(CFLAGS) -c -MD -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false)
66+
$(Q)$(CC) $(CFLAGS) -c -MD -MF $(@:.o=.d) -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false)
6767
@# The following fixes the dependency file.
6868
@# See http://make.paulandlesley.org/autodep.html for details.
6969
@# Regex adjusted from the above to play better with Windows paths, etc.
@@ -75,7 +75,7 @@ endef
7575

7676
define compile_cxx
7777
$(ECHO) "CXX $<"
78-
$(Q)$(CXX) $(CXXFLAGS) -c -MD -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false)
78+
$(Q)$(CXX) $(CXXFLAGS) -c -MD -MF $(@:.o=.d) -o $@ $< || (echo -e $(HELP_BUILD_ERROR); false)
7979
@# The following fixes the dependency file.
8080
@# See http://make.paulandlesley.org/autodep.html for details.
8181
@# Regex adjusted from the above to play better with Windows paths, etc.

0 commit comments

Comments
 (0)