Commits

Dimitar Trendafilov committed 2f023d6 Merge

* merged with upstream

Comments (0)

Files changed (4)

 * Patch 3353975: Support usage of premake as a library (Konstantin Tokarev)
 * Patch 3505903: Fix VC2010 project reference paths (Pavel Czerný)
 * Patch 3305599: Add -Wextra to ExtraWarnings (ergosys)
+* Patch 3476176: Fix dependencies of precompiled header in makefile (Konstantin Tokarev)
 
 
 -------

src/actions/make/make_cpp.lua

 		
 		-- include the dependencies, built by GCC (with the -MMD flag)
 		_p('-include $(OBJECTS:%%.o=%%.d)')
+		_p('ifneq (,$(PCH))')
+			_p('  -include $(OBJDIR)/$(notdir $(PCH)).d')
+		_p('endif')
 	end
 
 
 -- Build command for a single file.
 --
 
-	function cpp.buildcommand(prj)
+	function cpp.buildcommand(prj, objext)
 		local flags = iif(prj.language == "C", '$(CC) $(CFLAGS)', '$(CXX) $(CXXFLAGS)')
-		_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.o=%%.d)" -c "$<"', flags)
+		_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.%s=%%.d)" -c "$<"', flags, objext)
 	end
 
 
 			local objectname = project.getfileobject(prj, node.abspath)
 			_p('$(OBJDIR)/%s.o: %s', make.esc(objectname), make.esc(node.relpath))
 			_p('\t@echo $(notdir $<)')
-			cpp.buildcommand(prj)
+			cpp.buildcommand(prj, "o")
 			
 		-- resource file
 		elseif path.isresourcefile(node.abspath) then
 		_p('else')
 		_p('\t$(SILENT) xcopy /D /Y /Q "$(subst /,\\,$<)" "$(subst /,\\,$(OBJDIR))" 1>nul')
 		_p('endif')
-		cpp.buildcommand(prj)
+		cpp.buildcommand(prj, "gch")
 		_p('endif')
 		_p('')
 	end

tests/actions/make/cpp/test_make_pch.lua

 else
 	$(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
 endif
-	$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
+	$(SILENT) $(CXX) $(CXXFLAGS) -o "$@" -MF $(@:%.gch=%.d) -c "$<"
 endif
 		]]
 	end
 else
 	$(SILENT) xcopy /D /Y /Q "$(subst /,\,$<)" "$(subst /,\,$(OBJDIR))" 1>nul
 endif
-	$(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.o=%.d) -c "$<"
+	$(SILENT) $(CC) $(CFLAGS) -o "$@" -MF $(@:%.gch=%.d) -c "$<"
 endif
 		]]
 	end

tests/config/test_linkinfo.lua

 
 
 --
--- The import library extension should change if the a 
+-- The import library extension should not change if the a 
 -- custom target extension is set.
 --