From 7c9dea1f22e2b7dc82ea7ef88be0a9350ec00b55 Mon Sep 17 00:00:00 2001 From: Jason Perkins Date: Mon, 19 Sep 2011 16:45:49 -0400 Subject: Patch 3035550: Make/Distcc outputs dependencies to wrong location --- CHANGES.txt | 2 ++ src/actions/make/make_cpp.lua | 24 ++++++++++++++---------- tests/actions/make/test_make_pch.lua | 4 ++-- tests/actions/make/test_wiidev.lua | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 95d539b..601185f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -30,6 +30,8 @@ * Added os.stat * Bug 3381149: Path of PCH source file in VS10 not being translated (intyuh) * Patch 3021550: Add Wii homebrew platform (Pathogen David) +* Patch 3035550: Make/Distcc outputs dependencies to wrong location + ------- 4.3 diff --git a/src/actions/make/make_cpp.lua b/src/actions/make/make_cpp.lua index f2deaef..0e5570a 100644 --- a/src/actions/make/make_cpp.lua +++ b/src/actions/make/make_cpp.lua @@ -114,11 +114,7 @@ if path.iscppfile(file) then _p('$(OBJDIR)/%s.o: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file)) _p('\t@echo $(notdir $<)') - if (path.iscfile(file)) then - _p('\t$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"') - else - _p('\t$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"') - end + cpp.buildcommand(path.iscfile(file)) elseif (path.getextension(file) == ".rc") then _p('$(OBJDIR)/%s.res: %s', _MAKE.esc(path.getbasename(file)), _MAKE.esc(file)) _p('\t@echo $(notdir $<)') @@ -285,11 +281,19 @@ _p('$(GCH): $(PCH)') _p('\t@echo $(notdir $<)') _p('\t-$(SILENT) cp $< $(OBJDIR)') - if prj.language == "C" then - _p('\t$(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<"') - else - _p('\t$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<"') - end + cpp.buildcommand(prj.language == "C") _p('endif') _p('') end + + +-- +-- Build command for a single file. +-- + + function cpp.buildcommand(iscfile) + local flags = iif(iscfile, '$(CC) $(CFLAGS)', '$(CXX) $(CXXFLAGS)') + _p('\t$(SILENT) %s -o "$@" -MF $(@:%%.o=%%.d) -c "$<"', flags) + end + + diff --git a/tests/actions/make/test_make_pch.lua b/tests/actions/make/test_make_pch.lua index 8d772d4..2315f31 100644 --- a/tests/actions/make/test_make_pch.lua +++ b/tests/actions/make/test_make_pch.lua @@ -69,7 +69,7 @@ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) - $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -c "$<" + $(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] end @@ -84,7 +84,7 @@ ifneq (,$(PCH)) $(GCH): $(PCH) @echo $(notdir $<) -$(SILENT) cp $< $(OBJDIR) - $(SILENT) $(CC) $(CFLAGS) -o "$@" -c "$<" + $(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<" endif ]] end diff --git a/tests/actions/make/test_wiidev.lua b/tests/actions/make/test_wiidev.lua index 9ed707f..fd0bfdd 100644 --- a/tests/actions/make/test_wiidev.lua +++ b/tests/actions/make/test_wiidev.lua @@ -35,7 +35,7 @@ CPPFLAGS += -MMD -MP -I$(LIBOGC_INC) $(MACHDEP) -MP $(DEFINES) $(INCLUDES) CFLAGS += $(CPPFLAGS) $(ARCH) CXXFLAGS += $(CFLAGS) - LDFLAGS += -s lwiiuse -lbte -logc -lm -L$(LIBOGC_LIB) $(MACHDEP) + LDFLAGS += -s -L$(LIBOGC_LIB) $(MACHDEP) RESFLAGS += $(DEFINES) $(INCLUDES) ]] end -- cgit v1.2.3