File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,13 +68,7 @@ ${OBJS}: gen/config.mk
6868# Save the version number to this file, but only update version.c if it changes
6969gen/version.i.new ::
7070 @${MKDIR} ${@ D}
71- @if [ " $$ VERSION" ]; then \
72- printf ' %s' " $$ VERSION" ; \
73- elif test -e src/../.git && command -v git > /dev/null 2>&1 ; then \
74- git -C src/.. describe --always --dirty; \
75- else \
76- echo " 4.0.1" ; \
77- fi | tr -d ' \n' | build/embed.sh > $@
71+ @build/version.sh | tr -d ' \n' | build/embed.sh > $@
7872
7973gen/version.i : gen/version.i.new
8074 @test -e $@ && cmp -s $@ ${.ALLSRC} && ${RM} ${.ALLSRC} || mv ${.ALLSRC} $@
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # Copyright © Tavian Barnes <tavianator@tavianator.com>
4+ # SPDX-License-Identifier: 0BSD
5+
6+ # Print the version number
7+
8+ set -eu
9+
10+ DIR=" $( dirname -- " $0 " ) /.."
11+
12+ if [ " ${VERSION-} " ]; then
13+ printf ' %s' " $VERSION "
14+ elif [ -e " $DIR /.git" ] && command -v git > /dev/null 2>&1 ; then
15+ git -C " $DIR " describe --always --dirty
16+ else
17+ echo " 4.0.1"
18+ fi
You can’t perform that action at this time.
0 commit comments