Skip to content

Commit b594c97

Browse files
j6tgitster
authored andcommittedJan 23, 2014
Makefile: Fix compilation of Windows resource file
If the git version number consists of less than three period separated numbers, then the Windows resource file compilation issues a syntax error: $ touch git.rc $ make V=1 git.res GIT_VERSION = 1.9.rc0 windres -O coff \ -DMAJOR=1 -DMINOR=9 -DPATCH=rc0 \ -DGIT_VERSION="\\\"1.9.rc0\\\"" git.rc -o git.res C:\msysgit\msysgit\mingw\bin\windres.exe: git.rc:2: syntax error make: *** [git.res] Error 1 $ Note that -DPATCH=rc0. The values passed via -DMAJOR=, -DMINOR=, and -DPATCH= are used in FILEVERSION and PRODUCTVERSION statements, which expect up to four numeric values. These version numbers are intended for machine consumption. They are typically inspected by installers to decide whether a file to be installed is newer than one that exists on the system, but are not used for much else. We can be pretty certain that there are no tools that look at these version numbers, not even the installer of Git for Windows does. Therefore, to fix the syntax error, fill in only the first two numbers, which we are guaranteed to find in Git version numbers. Signed-off-by: Johannes Sixt <[email protected]> Acked-by: Pat Thoyts <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b21c0bc commit b594c97

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ $(SCRIPT_LIB) : % : %.sh GIT-SCRIPT-DEFINES
17731773

17741774
git.res: git.rc GIT-VERSION-FILE
17751775
$(QUIET_RC)$(RC) \
1776-
$(join -DMAJOR= -DMINOR= -DPATCH=, $(wordlist 1,3,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
1776+
$(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
17771777
-DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
17781778

17791779
ifndef NO_PERL

‎git.rc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1 VERSIONINFO
2-
FILEVERSION MAJOR,MINOR,PATCH,0
3-
PRODUCTVERSION MAJOR,MINOR,PATCH,0
2+
FILEVERSION MAJOR,MINOR,0,0
3+
PRODUCTVERSION MAJOR,MINOR,0,0
44
BEGIN
55
BLOCK "StringFileInfo"
66
BEGIN

0 commit comments

Comments
 (0)