This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Commit e55fd2d
committed
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]>1 parent c7f5edd commit e55fd2d
3 files changed
+80
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
5 | 8 | | |
6 | | - | |
7 | | - | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
30 | 32 | | |
31 | 33 | | |
32 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
33 | 50 | | |
| 51 | + | |
| 52 | + | |
34 | 53 | | |
35 | 54 | | |
36 | 55 | | |
37 | 56 | | |
38 | | - | |
| 57 | + | |
39 | 58 | | |
40 | 59 | | |
41 | 60 | | |
| |||
197 | 216 | | |
198 | 217 | | |
199 | 218 | | |
| 219 | + | |
200 | 220 | | |
201 | 221 | | |
202 | 222 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
0 commit comments