summaryrefslogtreecommitdiff
path: root/Makefile.src.in
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-09-07 21:01:24 +0000
committersmatz <smatz@openttd.org>2009-09-07 21:01:24 +0000
commit434693b8389a5816d73f089e064819a19f76f798 (patch)
tree4f28bf30f0060e2ec00959a48f107162314ff499 /Makefile.src.in
parentfe7032a7a6efdd19b38a5a79b5a36bbe4cfdc6e7 (diff)
downloadopenttd-434693b8389a5816d73f089e064819a19f76f798.tar.xz
(svn r17464) -Codechange: use C++0x mode when compiling with gcc >= 4.3 or icc >= 11.0
Diffstat (limited to 'Makefile.src.in')
-rw-r--r--Makefile.src.in12
1 files changed, 7 insertions, 5 deletions
diff --git a/Makefile.src.in b/Makefile.src.in
index 8f6ce81d0..3b32cc824 100644
--- a/Makefile.src.in
+++ b/Makefile.src.in
@@ -13,6 +13,8 @@ WINDRES = !!WINDRES!!
STRIP = !!STRIP!!
CFLAGS = !!CFLAGS!!
CFLAGS_BUILD = !!CFLAGS_BUILD!!
+CXXFLAGS = !!CXXFLAGS!!
+CXXFLAGS_BUILD = !!CXXFLAGS_BUILD!!
LIBS = !!LIBS!!
LDFLAGS = !!LDFLAGS!!
LDFLAGS_BUILD = !!LDFLAGS_BUILD!!
@@ -107,7 +109,7 @@ REV_NR := 0
endif
# This helps to recompile if flags change
-RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CFLAGS)" ]; then echo "$(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
+RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CXXFLAGS) $(CFLAGS)" ]; then echo "$(CXXFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
@@ -140,7 +142,7 @@ $(OBJS_C:%.o=%.d): %.d: $(SRC_DIR)/%.c $(FILE_DEP)
$(OBJS_CPP:%.o=%.d): %.d: $(SRC_DIR)/%.cpp $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.cpp=%.cpp)'
- $(Q)$(CXX_HOST) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
+ $(Q)$(CXX_HOST) $(CXXFLAGS) $(CFLAGS) -MM $< | sed 's@^$(@F:%.d=%.o):@$@ $(@:%.d=%.o):@' > $@
$(OBJS_MM:%.o=%.d): %.d: $(SRC_DIR)/%.mm $(FILE_DEP)
$(E) '$(STAGE) DEP $(<:$(SRC_DIR)/%.mm=%.mm)'
@@ -164,7 +166,7 @@ ifeq ("$(SRC_OBJS_DIR)/$(DEPEND)","$(MAKEDEPEND)")
DEP := $(MAKEDEPEND)
$(SRC_OBJS_DIR)/$(DEPEND): $(SRC_DIR)/depend/depend.cpp
$(E) '$(STAGE) Compiling and linking $(DEPEND)'
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $(LDFLAGS_BUILD) -o $@ $<
+ $(Q)$(CXX_BUILD) $(CXXFLAGS_BUILD) $(CFLAGS_BUILD) $(LDFLAGS_BUILD) -o $@ $<
endif
# Make sure that only 'make depend' ALWAYS triggers a recheck
@@ -232,7 +234,7 @@ $(OBJS_C): %.o: $(SRC_DIR)/%.c $(DEP_MASK) $(FILE_DEP)
$(OBJS_CPP): %.o: $(SRC_DIR)/%.cpp $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.cpp=%.cpp)'
- $(Q)$(CXX_HOST) $(CFLAGS) -c -o $@ $<
+ $(Q)$(CXX_HOST) $(CXXFLAGS) $(CFLAGS) -c -o $@ $<
$(OBJS_MM): %.o: $(SRC_DIR)/%.mm $(DEP_MASK) $(FILE_DEP)
$(E) '$(STAGE) Compiling $(<:$(SRC_DIR)/%.mm=%.mm)'
@@ -271,7 +273,7 @@ endian_target.h: $(ENDIAN_CHECK) $(CONFIG_CACHE_ENDIAN)
$(ENDIAN_CHECK): $(SRC_DIR)/endian_check.cpp
$(E) '$(STAGE) Compiling and Linking $@'
- $(Q)$(CXX_BUILD) $(CFLAGS_BUILD) $< -o $@
+ $(Q)$(CXX_BUILD) $(CXXFLAGS_BUILD) $(CFLAGS_BUILD) $< -o $@
# Revision files