diff options
author | Max Horn | 2009-09-25 12:11:27 +0000 |
---|---|---|
committer | Max Horn | 2009-09-25 12:11:27 +0000 |
commit | 26f2597fd1d8f7b5264ffa12d2d80a690d0f4503 (patch) | |
tree | 3c082dd6fc990523d0f9caa1233f99cc430f4603 /Makefile.common | |
parent | f91f4d4186f06281f3e1cd3c2b267f6dd9018220 (diff) | |
download | scummvm-rg350-26f2597fd1d8f7b5264ffa12d2d80a690d0f4503.tar.gz scummvm-rg350-26f2597fd1d8f7b5264ffa12d2d80a690d0f4503.tar.bz2 scummvm-rg350-26f2597fd1d8f7b5264ffa12d2d80a690d0f4503.zip |
Modified version of patch #2838507: Add support for non-gcc compilers to configure, Makefile etc
svn-id: r44348
Diffstat (limited to 'Makefile.common')
-rw-r--r-- | Makefile.common | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Makefile.common b/Makefile.common index 6c0e2101ad..790dca8f89 100644 --- a/Makefile.common +++ b/Makefile.common @@ -89,34 +89,34 @@ clean: $(RM_REC) $(DEPDIRS) $(RM) $(OBJS) $(EXECUTABLE) -# Old (dumb) compile & dependcy rules -#INCS = scumm/scumm.h common/scummsys.h -#.cpp.o: -# $(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o -#$(OBJS): $(INCS) - -ifndef HAVE_GCC3 -# If you use GCC, disable the above and enable this for intelligent + +# +# The build rules for object files. +# + +ifdef CXX_UPDATE_DEP_FLAG + +# Build rule for C++ files. Makes use of CXX_UPDATE_DEP_FLAG for advanced # dependency tracking. %.o: %.cpp $(QUIET)$(MKDIR) $(*D)/$(DEPDIR) - $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o - $(QUIET)$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d - $(QUIET)$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d" - $(QUIET)$(RM) "$(*D)/$(DEPDIR)/$(*F).d2" -else -# If you even have GCC 3.x, you can use this build rule, which is safer; the above -# rule can get you into a bad state if you Ctrl-C at the wrong moment. -# Also, with this GCC inserts additional dummy rules for the involved headers, -# which ensures a smooth compilation even if said headers become obsolete. -%.o: %.cpp - $(QUIET)$(MKDIR) $(*D)/$(DEPDIR) - $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + $(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + +# Build rule for Objective-C files. Strictly speaking, this is for OS X only. %.o: %.m $(QUIET)$(MKDIR) $(*D)/$(DEPDIR) - $(QUIET_CXX)$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(OBJCFLAGS) -c $(<) -o $*.o + $(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(OBJCFLAGS) -c $(<) -o $*.o + +else + +# Dumb compile rule, for C++ compilers that don't allow dependency tracking or +# where it is broken (such as GCC 2.95). +.cpp.o: + $(QUIET_CXX)$(CXX) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o + endif + %.o: %.s $(QUIET_AS)$(AS) $(ASFLAGS) $(<) -o $*.o |