nsis: Getting the Vim version number via makensis

closes: #18470

Signed-off-by: RestorerZ <restorer@mail2k.ru>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
RestorerZ
2025-10-03 14:12:41 +00:00
committed by Christian Brabandt
parent 8feaa94e77
commit fabe9a4c88
6 changed files with 17 additions and 98 deletions

View File

@ -1,6 +1,6 @@
#
# Makefile for UNIX-like for create self-installing exe of Vim.
# 15/12/2024, Restorer restorer@mail2k.ru
# 2025-10-03, Restorer, restorer@mail2k.ru
#
@ -51,13 +51,6 @@ ifdef X
XX := -X"$(X:;=" -X")"
endif
MAJOR != grep -E 'VIM_VERSION_MAJOR\s{2,}' ../src/version.h | \
awk '{ printf "%d",$$3 }'
MINOR != grep -E 'VIM_VERSION_MINOR\s{2,}' ../src/version.h | \
awk '{ printf "%d",$$3 }'
PATCH != awk '/number below this line/,/,/' ../src/version.c | \
awk 'NR == 3 { printf "%04d",$$1 }' | sed -e 's/[ ,]//g'
MKNSISFLAGS := -INPUTCHARSET UTF8 $(MKNSISFLAGS)
all: makeinst
@ -65,21 +58,12 @@ all: makeinst
makeinst: prepare
makensis $(MKNSISFLAGS) gvim.nsi $(XX)
prepare: unzipicons gvim_version.nsh license rename
prepare: unzipicons license rename
unzipicons: icons.zip
if test -d `basename $? .zip` ; then rm -rf `basename $? .zip` ; fi
unzip $?
gvim_version.nsh: Makefile
echo "# Generated from Makefile: define the version numbers" > $@
echo "!ifndef __GVIM_VER__NSH__" >> $@
echo "!define __GVIM_VER__NSH__" >> $@
echo "!define VER_MAJOR $(MAJOR)" >> $@
echo "!define VER_MINOR $(MINOR)" >> $@
echo "!define PATCHLEVEL $(PATCH)" >> $@
echo "!endif" >> $@
license: ../lang/LICENSE.*.txt ../LICENSE
for lic in $? ; do \
bn=`basename $$lic .txt` ; \
@ -91,7 +75,6 @@ rename:
../tools/rename.bat "$(SRC)" "$(DST)"
clean:
if test -f gvim_version.nsh ; then rm -f gvim_version.nsh ; fi
rm -f ../lang/LICENSE*.nsis.txt
if test -d icons ; then rm -rf icons ; fi
if test -f gvim??.exe ; then rm -f gvim??.exe ; fi