aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2024-02-16 11:50:39 +0000
committerRon Yorston <rmy@pobox.com>2024-02-16 11:50:39 +0000
commita4bb355732f2902b936368b644fa08518ecce55a (patch)
treef53295432c8ca1b81126f49cf1c7952512f5b38b
parent2401501759c4ff5dcc7c022a9c2194b504bdf0d6 (diff)
downloadbusybox-w32-a4bb355732f2902b936368b644fa08518ecce55a.tar.gz
busybox-w32-a4bb355732f2902b936368b644fa08518ecce55a.tar.bz2
busybox-w32-a4bb355732f2902b936368b644fa08518ecce55a.zip
build system: improvements to EXTRAVERSION detection
The previous commit to detect EXTRAVERSION more accurately was lacking in some respects: - Only attempt to detect EXTRAVERSION if it's currently set to the default value '.git'. - Use immediate-expansion macro assignments to avoid time-consuming repeated evaluations. - Remove a useless use of cat. - Correctly allow for the output being sent to a separate directory.
-rw-r--r--Makefile17
1 files changed, 9 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 36d66d2d0..c12b7791f 100644
--- a/Makefile
+++ b/Makefile
@@ -376,24 +376,25 @@ CONFIG_PLATFORM_MINGW32 := $(subst ",,$(CONFIG_PLATFORM_MINGW32))
376#") 376#")
377endif 377endif
378 378
379# Try various methods to get a more specific EXTRAVERSION 379# Try various methods to get a more specific EXTRAVERSION, but only
380ifeq ($(CONFIG_PLATFORM_MINGW32),y) 380# for MINGW32 platform and if EXTRAVERSION is default '.git'
381ifeq ($(CONFIG_PLATFORM_MINGW32)$(EXTRAVERSION),y.git)
381# Ask git 382# Ask git
382extraversion = $(shell git describe --match FRP 2>/dev/null) 383extraversion := $(shell cd $(srctree) && git describe --match FRP 2>/dev/null)
383ifeq ($(strip $(extraversion)),) 384ifeq ($(strip $(extraversion)),)
384# That didn't work, look for a .frp_describe file 385# That didn't work, look for a .frp_describe file
385extraversion = $(shell cat .frp_describe 2>/dev/null | grep '^FRP-') 386extraversion := $(shell grep '^FRP-' $(srctree)/.frp_describe 2>/dev/null)
386ifeq ($(strip $(extraversion)),) 387ifeq ($(strip $(extraversion)),)
387# That didn't work either, look at current directory name 388# That didn't work either, look at name of source directory
388e1 = $(shell basename `pwd` | grep '^busybox-w32-FRP-') 389e1 := $(shell basename $(srctree) | grep '^busybox-w32-FRP-')
389ifneq ($(strip $(e1)),) 390ifneq ($(strip $(e1)),)
390extraversion = $(subst busybox-w32-,,$(e1)) 391extraversion := $(subst busybox-w32-,,$(e1))
391endif 392endif
392endif 393endif
393endif 394endif
394 395
395ifneq ($(strip $(extraversion)),) 396ifneq ($(strip $(extraversion)),)
396EXTRAVERSION = .$(subst FRP,git,$(extraversion)) 397EXTRAVERSION := .$(subst FRP,git,$(extraversion))
397endif 398endif
398endif 399endif
399 400