diff options
author | Ron Yorston <rmy@pobox.com> | 2024-02-15 09:32:12 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2024-02-15 09:32:12 +0000 |
commit | 2401501759c4ff5dcc7c022a9c2194b504bdf0d6 (patch) | |
tree | e4832a6b1a3ba369ce65cc57e1a9589bc10ebd06 | |
parent | 58627310e90247040894d3aeab2fc79bcced11be (diff) | |
download | busybox-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-- | .gitignore | 5 | ||||
-rw-r--r-- | Makefile | 29 |
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 | ||
@@ -368,6 +368,35 @@ AFLAGS := $(AFLAGS) | |||
368 | LDFLAGS := $(LDFLAGS) | 368 | LDFLAGS := $(LDFLAGS) |
369 | LDLIBS := | 369 | LDLIBS := |
370 | 370 | ||
371 | CONFIG_PLATFORM_MINGW32 ?= | ||
372 | ifeq ($(CONFIG_PLATFORM_MINGW32),) | ||
373 | CONFIG_PLATFORM_MINGW32 := $(shell grep ^CONFIG_PLATFORM_MINGW32= .config 2>/dev/null) | ||
374 | CONFIG_PLATFORM_MINGW32 := $(subst CONFIG_PLATFORM_MINGW32=,,$(CONFIG_PLATFORM_MINGW32)) | ||
375 | CONFIG_PLATFORM_MINGW32 := $(subst ",,$(CONFIG_PLATFORM_MINGW32)) | ||
376 | #") | ||
377 | endif | ||
378 | |||
379 | # Try various methods to get a more specific EXTRAVERSION | ||
380 | ifeq ($(CONFIG_PLATFORM_MINGW32),y) | ||
381 | # Ask git | ||
382 | extraversion = $(shell git describe --match FRP 2>/dev/null) | ||
383 | ifeq ($(strip $(extraversion)),) | ||
384 | # That didn't work, look for a .frp_describe file | ||
385 | extraversion = $(shell cat .frp_describe 2>/dev/null | grep '^FRP-') | ||
386 | ifeq ($(strip $(extraversion)),) | ||
387 | # That didn't work either, look at current directory name | ||
388 | e1 = $(shell basename `pwd` | grep '^busybox-w32-FRP-') | ||
389 | ifneq ($(strip $(e1)),) | ||
390 | extraversion = $(subst busybox-w32-,,$(e1)) | ||
391 | endif | ||
392 | endif | ||
393 | endif | ||
394 | |||
395 | ifneq ($(strip $(extraversion)),) | ||
396 | EXTRAVERSION = .$(subst FRP,git,$(extraversion)) | ||
397 | endif | ||
398 | endif | ||
399 | |||
371 | # Read KERNELRELEASE from .kernelrelease (if it exists) | 400 | # Read KERNELRELEASE from .kernelrelease (if it exists) |
372 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) | 401 | KERNELRELEASE = $(shell cat .kernelrelease 2> /dev/null) |
373 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) | 402 | KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |