| 1 |
From: Punit Agrawal <[email protected]> |
| 2 |
Date: Sun, 3 Mar 2019 09:16:24 +0900 |
| 3 |
Subject: Makefile: Fix version discovery |
| 4 |
|
| 5 |
Upstream uses git based discovery to generate versioning information |
| 6 |
for release tar balls. The invocation of the version generation script |
| 7 |
(localversion) doesn't work with packaging that lives in git |
| 8 |
repositories. |
| 9 |
|
| 10 |
Fix this by moving the relevant bits of versioning to the Makefile. |
| 11 |
--- |
| 12 |
Makefile.in | 10 ++++++---- |
| 13 |
1 file changed, 6 insertions(+), 4 deletions(-) |
| 14 |
|
| 15 |
diff --git a/Makefile.in b/Makefile.in |
| 16 |
index 65ae5a4..4c12a56 100644 |
| 17 |
--- a/Makefile.in |
| 18 |
+++ b/Makefile.in |
| 19 |
@@ -27,6 +27,8 @@ SOURCE = $(shell find . -maxdepth 1 ! -name version.h -a -name '*.[h]') |
| 20 |
SOURCE += *.c *.lds Makefile |
| 21 |
NODEPTARGETS=<version.h> <clean> |
| 22 |
|
| 23 |
+REL_VERSION=2.23 |
| 24 |
+ |
| 25 |
INSTALL = install |
| 26 |
|
| 27 |
LDFLAGS += -ldl |
| 28 |
@@ -287,11 +289,11 @@ $(OBJDIRS): %: |
| 29 |
@mkdir -p $@ |
| 30 |
|
| 31 |
# <Version handling> |
| 32 |
-$(VERSION): always |
| 33 |
+$(VERSION): FORCE |
| 34 |
@$(VECHO) VERSION |
| 35 |
- ./localversion version $(SOURCE) |
| 36 |
-always: |
| 37 |
-# </Version handling> |
| 38 |
+ printf "// %s\n" "${REL_VERSION}" > $@ |
| 39 |
+ printf "#define VERSION \"%s\"\n" "${REL_VERSION}" >> $@ |
| 40 |
+FORCE: |
| 41 |
|
| 42 |
snapshot: $(VERSION) |
| 43 |
|