aboutsummaryrefslogtreecommitdiff
path: root/Makefile.common
diff options
context:
space:
mode:
authorYauheni Kaliuta2019-11-24 19:28:37 +0200
committerEugene Sandulenko2019-11-30 10:51:50 +0100
commit22a2a392d3234139acd02fab99da6f2959ae1893 (patch)
tree205e8f55982eb6ccf4087283e9cfba03b0b22d86 /Makefile.common
parentec12c5acbdfdf332ea8993f22234f7a698aa58da (diff)
downloadscummvm-rg350-22a2a392d3234139acd02fab99da6f2959ae1893.tar.gz
scummvm-rg350-22a2a392d3234139acd02fab99da6f2959ae1893.tar.bz2
scummvm-rg350-22a2a392d3234139acd02fab99da6f2959ae1893.zip
BUILD: Fix Version Define Being Added to All Code Objects
Due to a quirk of target specific make variables which means they are added to all pre-requisities, this resulted in the defines which were meant to be applied only to the version module being applied to most of the codebase. This did not cause any direct issues, but was untidy and unexpected behaviour which was reported in Pull Request 1946 by janisozaur. Fix it by defining a special rule for version.o with own flags instead of using template rule. Signed-off-by: Yauheni Kaliuta <yauheni.kaliuta@redhat.com>
Diffstat (limited to 'Makefile.common')
-rw-r--r--Makefile.common11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile.common b/Makefile.common
index 95b090acd3..3d2739f9bf 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -136,6 +136,10 @@ ifdef CXX_UPDATE_DEP_FLAG
$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
$(QUIET_AS)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(ASFLAGS) -c $(<) -o $*.o
+base/version.o: base/version.cpp
+ $(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+ $(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(VERFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+
else
# Dumb compile rule, for C++ compilers that don't allow dependency tracking or
@@ -149,6 +153,9 @@ else
$(QUIET)$(MKDIR) $(*D)
$(QUIET_AS)$(CXX) $(ASFLAGS) -c $(<) -o $*.o
+base/version.o: base/version.cpp
+ $(QUIET)$(MKDIR) $(*D)
+ $(QUIET_CXX)$(CXX) $(CXXFLAGS) $(VERFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
endif
# Build rule for assembler files
@@ -192,7 +199,7 @@ VER_EXTRA = $(shell echo $(VERSION) | cut -d. -f 3 | cut -c2-)
ifdef AMIGAOS
# Amiga needs date in specific format for the version cookie
AMIGA_DATE = $(shell gdate '+%d.%m.%Y')
-base/version.o: CXXFLAGS:=$(CXXFLAGS) -DAMIGA_DATE=\"$(AMIGA_DATE)\"
+VERFLAGS += -DAMIGA_DATE=\"$(AMIGA_DATE)\"
endif
######################################################################
@@ -214,7 +221,7 @@ endif
# Define the Subversion revision if available, either autodetected or
# specified by the user, but only for base/version.cpp.
ifneq ($(origin VER_REV), undefined)
-base/version.o: CXXFLAGS:=$(CXXFLAGS) -DSCUMMVM_REVISION=\"$(VER_REV)\"
+VERFLAGS += -DSCUMMVM_REVISION=\"$(VER_REV)\"
endif
######################################################################