]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUILD: makefile: add an EXTRAVERSION variable to ease local naming
authorWilly Tarreau <w@1wt.eu>
Thu, 1 Oct 2020 02:05:39 +0000 (04:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 1 Oct 2020 02:13:36 +0000 (04:13 +0200)
commitac32b4b98ca29e0e065a8e6725f1265adab51a33
tree43b6da79677a7aa3d67eb54c172ba6feead9880c
parent5018aacae5f2fb65365bce5a3a390c5126203952
BUILD: makefile: add an EXTRAVERSION variable to ease local naming

Sometimes it's desirable to append local version naming to packages,
and currently it can only be done using SUBVERS which is already set
by default to the git commit ID and patch count since last known tag,
making the addition a bit complicated.

Let's just add a new EXTRAVERSION field that is empty by default, and
systematically appended verbatim to the version string everywhere. This
way it becomes trivial to append some local strings, such as:

   make TARGET=foo EXTRAVERSION=+$(quilt applied|wc -l)
   -> 2.3-dev5-5018aa-15+1

or :

   make TARGET=foo EXTRAVERSION=-$(date +%F)
   -> 2.3-dev5-5018aa-15-20200110

Let's be careful not to add double quotes (used as the string delimiter)
nor spaces (which can confuse version parsers on the output). The extra
version is also used to name a tarball. It's always pre-initialized to an
empty string so that it's not accidently inherited from the environment.
It's not reported in "make version" to avoid fooling tools (it would be
pointless anyway).

As a side effect it also becomes possible to force VERSION and SUBVERS
to an empty string and use EXTRAVERSION alone to force a specific version
(could possibly be useful when bisecting from patch queues outside of Git
for example).
Makefile