You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Makefile: automatically determine the bundle server version
Add a 'VERSION-FILE' target that generates a value for the Makefile
'VERSION' using 'git describe'.
The process for generating this file is based off of the 'GIT-VERSION-FILE'
target in the Git project's Makefile, with some minor changes for the sake
of efficiency.
If the 'VERSION' is set by the caller (e.g. with 'make VERSION=1.0.0'), the
'VERSION-FILE' target is a .PHONY (i.e., non-file, always run) target.
Conversely, if 'VERSION' is not set, 'VERSION-FILE' is instead a real file
target and is loaded into the Makefile with '-include VERSION-FILE'. Its
recipe runs the script 'generate-version.sh' to determine a version and
write 'VERSION := <string>' to 'VERSION-FILE' *if and only if* its contents
change. Finally, the 'VERSION-FILE' target depends on a .PHONY 'FORCE'
target, ensuring it is always re-run.
If the contents of 'VERSION-FILE' change as a result of
'generate-version.sh', the full 'Makefile' is re-evaluated. This ensures
that 'VERSION' is up-to-date with the contents of 'VERSION-FILE'.
Finally, compile the 'VERSION' into 'git-bundle-server' by setting the appropriate '-ldflags'.
Signed-off-by: Victoria Dye <[email protected]>
0 commit comments