aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-02-15 09:32:12 +0000
committerRon Yorston <rmy@pobox.com>2024-02-15 09:32:12 +0000
commit2401501759c4ff5dcc7c022a9c2194b504bdf0d6 (patch)
treee4832a6b1a3ba369ce65cc57e1a9589bc10ebd06
parent58627310e90247040894d3aeab2fc79bcced11be (diff)
downloadbusybox-w32-2401501759c4ff5dcc7c022a9c2194b504bdf0d6.tar.gz
busybox-w32-2401501759c4ff5dcc7c022a9c2194b504bdf0d6.tar.bz2
busybox-w32-2401501759c4ff5dcc7c022a9c2194b504bdf0d6.zip
build system: try to find a more precise EXTRAVERSION
The default EXTRAVERSION is .git. Use some clues to determine a more precise EXTRAVERSION: - git describe - A .frp_describe file embedded in the release tarball - The name of the build directory: tarballs of release tags from GitLab and GitHub include the version in the directory name.
-rw-r--r--.gitignore5
-rw-r--r--Makefile29
2 files changed, 34 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index a4031f6ec..9055b745e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -63,3 +63,8 @@ TAGS
63# user-supplied scripts 63# user-supplied scripts
64# 64#
65/embed 65/embed
66
67#
68# release description for tarball
69#
70.frp_describe
diff --git a/Makefile b/Makefile
index 9dd359244..36d66d2d0 100644
--- a/Makefile
+++ b/Makefile
@@ -368,6 +368,35 @@ AFLAGS := $(AFLAGS)
368LDFLAGS := $(LDFLAGS) 368LDFLAGS := $(LDFLAGS)
369LDLIBS := 369LDLIBS :=
370 370
371CONFIG_PLATFORM_MINGW32 ?=
372ifeq ($(CONFIG_PLATFORM_MINGW32),)
373CONFIG_PLATFORM_MINGW32 := $(shell grep ^CONFIG_PLATFORM_MINGW32= .config 2>/dev/null)
374CONFIG_PLATFORM_MINGW32 := $(subst CONFIG_PLATFORM_MINGW32=,,$(CONFIG_PLATFORM_MINGW32))
375CONFIG_PLATFORM_MINGW32 := $(subst ",,$(CONFIG_PLATFORM_MINGW32))
376#")
377endif
378
379# Try various methods to get a more specific EXTRAVERSION
380ifeq ($(CONFIG_PLATFORM_MINGW32),y)
381# Ask git
382extraversion = $(shell git describe --match FRP 2>/dev/null)
383ifeq ($(strip $(extraversion)),)
384# That didn't work, look for a .frp_describe file
385extraversion = $(shell cat .frp_describe 2>/dev/null | grep '^FRP-')
386ifeq ($(strip $(extraversion)),)
387# That didn't work either, look at current directory name
388e1 = $(shell basename `pwd` | grep '^busybox-w32-FRP-')
389ifneq ($(strip $(e1)),)
390extraversion = $(subst busybox-w32-,,$(e1))
391endif
392endif
393endif
394
395ifneq ($(strip $(extraversion)),)
396EXTRAVERSION = .$(subst FRP,git,$(extraversion))
397endif
398endif
399
371# Read KERNELRELEASE from .kernelrelease (if it exists) 400# Read KERNELRELEASE from .kernelrelease (if it exists)
372KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) 401KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null)
373KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) 402KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)