Skip to content

Commit 99d7b9d

Browse files
committed
Fix some makefiles issues.
Automatically run updateSCCSVersions on Mac and Windows when required Use $(MAKE) not make to recursively invoke make on Mac. Allow revertUnchangedPlugins to be used from a remote directory.
1 parent 8501857 commit 99d7b9d

File tree

7 files changed

+41
-14
lines changed

7 files changed

+41
-14
lines changed

build.macos32x86/common/Makefile.plugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ else
241241
endif
242242

243243
getversion:
244-
make -f ../common/Makefile.vm getversion
244+
$(MAKE) -f ../common/Makefile.vm getversion
245245

246246
else # ifeq ($(realpath $(PREREQUISITES)),$(PREREQUISITES))
247247
# If any prerequisites are missing simply create a .ignore file

build.macos32x86/common/Makefile.vm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Generic Makefile for Mac OS VM
3-
# Do make getversion to get makwe -n to work
3+
# Do make getversion to get make -n to work
44
#
55
# This is designed to be invoked by Makefile in a specific build directory via
66
# include ../common/Makefile.app
@@ -123,7 +123,14 @@ INCLUDES:= $(addprefix -I,. $(SRCDIRS))
123123
LD:= gcc
124124

125125
#############################################################################
126+
# Ensure version control info is up-to-date, and extract it from the file.
126127
#
128+
SCCSVER:=$(PLATDIR)/Cross/vm/sqSCCSVersion.h
129+
130+
ifneq ($(shell grep 'GitRawRevisionString.*$$Rev$$.' $(SCCSVER)),)
131+
$(shell bash -c "cd ../../scripts; ./updateSCCSVersions")
132+
endif
133+
127134
SVNREV:= $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9]*\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h)
128135

129136

build.macos64x64/common/Makefile.plugin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ else
236236
endif
237237

238238
getversion:
239-
make -f ../common/Makefile.vm getversion
239+
$(MAKE) -f ../common/Makefile.vm getversion
240240

241241
else # ifeq ($(realpath $(PREREQUISITES)),$(PREREQUISITES))
242242
# If any prerequisites are missing simply create a .ignore file

build.macos64x64/common/Makefile.vm

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Generic Makefile for Mac OS VM
3-
# Do make getversion to get makwe -n to work
3+
# Do make getversion to get make -n to work
44
#
55
# This is designed to be invoked by Makefile in a specific build directory via
66
# include ../common/Makefile.app
@@ -118,8 +118,15 @@ INCLUDES:= $(addprefix -I,. $(SRCDIRS))
118118
LD:= gcc
119119

120120
#############################################################################
121+
# Ensure version control info is up-to-date, and extract it from the file.
121122
#
122-
SVNREV:= $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9]*\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h)
123+
SCCSVER:=$(PLATDIR)/Cross/vm/sqSCCSVersion.h
124+
125+
ifneq ($(shell grep 'GitRawRevisionString.*$$Rev$$.' $(SCCSVER)),)
126+
$(shell bash -c "cd ../../scripts; ./updateSCCSVersions")
127+
endif
128+
129+
SVNREV:= $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9]*\).*/\\1/p" -e d $(SCCSVER))
123130

124131

125132
#############################################################################

build.win32x86/common/Makefile.tools

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ OBJCOPY:= $(TOOLPREFIX)objcopy
9191
# Note: RC compiles the .rc files into linkable .o files
9292
#
9393
RC:= $(TOOLPREFIX)windres
94-
SVNMAJOR := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9][0-9][0-9]\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
95-
SVNMINOR := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
96-
SVNREV := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
97-
SVNBUILD := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]*\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
94+
SCCSVER:=$(PLATDIR)/Cross/vm/sqSCCSVersion.h
95+
96+
ifneq ($(shell grep 'GitRawRevisionString.*$$Rev$$.' $(SCCSVER)),)
97+
$(shell bash -c "cd ../../scripts; ./updateSCCSVersions")
98+
endif
99+
SVNMAJOR := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9][0-9][0-9]\).*/\\1/p" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
100+
SVNMINOR := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
101+
SVNREV := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
102+
SVNBUILD := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]*\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
103+
98104
RCFLAGS:= --include-dir $(PLATDIR)/win32/misc -D_WIN32 -DFILEVERSIONVALUES=$(SVNMAJOR),$(SVNMINOR),$(SVNREV),$(SVNBUILD) '-DFILEVERSIONSTRING=\"$(SVNMAJOR).$(SVNMINOR).$(SVNREV).$(SVNBUILD)\\0\"'

build.win64x64/common/Makefile.tools

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,14 @@ OBJCOPY:= $(TOOLPREFIX)objcopy
9191
# Note: RC compiles the .rc files into linkable .o files
9292
#
9393
RC:= $(TOOLPREFIX)windres
94-
SVNMAJOR := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9][0-9][0-9]\).*/\\1/p" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
95-
SVNMINOR := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
96-
SVNREV := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
97-
SVNBUILD := $(shell sed -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]*\).*/\\1/p" -e "s/^0*//" -e d $(PLATDIR)/Cross/vm/sqSCCSVersion.h | sed -e 's/^0*//')
94+
SCCSVER:=$(PLATDIR)/Cross/vm/sqSCCSVersion.h
95+
96+
ifneq ($(shell grep 'GitRawRevisionString.*$$Rev$$.' $(SCCSVER)),)
97+
$(shell bash -c "cd ../../scripts; ./updateSCCSVersions")
98+
endif
99+
SVNMAJOR := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: \([0-9][0-9][0-9][0-9]\).*/\\1/p" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
100+
SVNMINOR := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
101+
SVNREV := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
102+
SVNBUILD := $(shell $(SED) -e "s/^static.*GitRawRevisionString.*Rev: [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\([0-9][0-9]*\).*/\\1/p" -e "s/^0*//" -e d $(SCCSVER) | $(SED) -e 's/^0*//')
103+
98104
RCFLAGS:= --include-dir $(PLATDIR)/win32/misc -D_WIN32 -DFILEVERSIONVALUES=$(SVNMAJOR),$(SVNMINOR),$(SVNREV),$(SVNBUILD) '-DFILEVERSIONSTRING=\"$(SVNMAJOR).$(SVNMINOR).$(SVNREV).$(SVNBUILD)\\0\"'

scripts/revertUnchangedPlugins

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
#IFS=<tab><nl>
66
IFS='
77
'
8+
PATH=$PATH:`dirname $0`
89
if [ $# = 0 ]; then
910
set -- src/plugins
1011
fi
1112
for pd in $@; do
1213
for d in $pd/[A-Z]*; do
1314
test -d "$d" || continue
1415
find "$d" -name .git -prune -o \( -type f -a -name '*.[ch]' \) -exec \
15-
scripts/revertIfEssentiallyUnchanged {} \;
16+
revertIfEssentiallyUnchanged {} \;
1617
done
1718
done

0 commit comments

Comments
 (0)