gmake2 bug fix. When generating gmake file with pch headers

for either gcc or clang, the generated
make files assumed the system had the touch command.
Which isn't true by default on windows.
This commit is contained in:
R. Blaine Whittle 2017-10-06 10:20:28 -07:00 committed by Tom van Dijck
parent a15c465d63
commit 9be911390d
2 changed files with 15 additions and 3 deletions

View File

@ -717,7 +717,11 @@
local cmd = iif(p.languages.isc(cfg.language), "$(CC) -x c-header $(ALL_CFLAGS)", "$(CXX) -x c++-header $(ALL_CXXFLAGS)")
_p('\t$(SILENT) %s -o "$@" -MF "$(@:%%.gch=%%.d)" -c "$<"', cmd)
_p('$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)')
_p('\t$(SILENT) touch "$@"')
_p('\tifeq (posix,$(SHELLTYPE))')
_p('\t\t$(SILENT) touch "$@"')
_p('\telse')
_p('\t\t$(SILENT) echo $null >> "$@"')
_p('\tendif')
_p('else')
_p('$(OBJECTS): | $(OBJDIR)')
_p('endif')

View File

@ -102,7 +102,11 @@ $(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
$(SILENT) $(CXX) -x c++-header $(ALL_CXXFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
$(SILENT) touch "$@"
ifeq (posix,$(SHELLTYPE))
$(SILENT) touch "$@"
else
$(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | $(OBJDIR)
endif
@ -125,7 +129,11 @@ $(GCH): $(PCH) | $(OBJDIR)
@echo $(notdir $<)
$(SILENT) $(CC) -x c-header $(ALL_CFLAGS) -o "$@" -MF "$(@:%.gch=%.d)" -c "$<"
$(PCH_PLACEHOLDER): $(GCH) | $(OBJDIR)
$(SILENT) touch "$@"
ifeq (posix,$(SHELLTYPE))
$(SILENT) touch "$@"
else
$(SILENT) echo $null >> "$@"
endif
else
$(OBJECTS): | $(OBJDIR)
endif