diff options
Diffstat (limited to 'mk/sys.vars.mk')
| -rw-r--r-- | mk/sys.vars.mk | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/mk/sys.vars.mk b/mk/sys.vars.mk index f8e6dd7f2c87..7d9cd2f6641f 100644 --- a/mk/sys.vars.mk +++ b/mk/sys.vars.mk @@ -1,4 +1,4 @@ -# $Id: sys.vars.mk,v 1.24 2025/11/19 17:44:15 sjg Exp $ +# $Id: sys.vars.mk,v 1.27 2026/03/13 16:02:44 sjg Exp $ # # @(#) Copyright (c) 2003-2023, Simon J. Gerraty # @@ -24,25 +24,21 @@ MAKE_VERSION ?= 0 MAKE_VERSION := ${MAKE_VERSION:[1]:C,.*-,,} .endif -.if ${MAKE_VERSION} < 20100414 +# from (20260210) .MAKE.VERSION is read-only +.MAKE.VERSION ?= ${MAKE_VERSION} + +.if ${.MAKE.VERSION} < 20100414 _this = ${.PARSEDIR}/${.PARSEFILE} .else _this = ${.PARSEDIR:tA}/${.PARSEFILE} .endif -# This is a boolean we can use in makefiles as below -.ifndef MAKE_POSIX_SHELL -MAKE_POSIX_SHELL != (echo $${PATH%:*}) > /dev/null 2>&1 && echo 1 || echo 0 -.export MAKE_POSIX_SHELL -.endif - -# This is a boolean we can use in target scripts -.ifndef isPOSIX_SHELL -.if ${MAKE_POSIX_SHELL} -isPOSIX_SHELL = : -.else -isPOSIX_SHELL = false -.endif +# This is a boolean we can use in makefiles: +# .if ${isPOSIX_SHELL:U:Nfalse} +# as well as in target scripts: +# if ${isPOSIX_SHELL:Ufalse}; then +.if empty(isPOSIX_SHELL) +isPOSIX_SHELL != (echo $${PATH%:*}) > /dev/null 2>&1 && echo : || echo false .export isPOSIX_SHELL .endif @@ -66,14 +62,14 @@ _type_sh = which .endif # :sh1 evaluates command only once and caches the result. -.if ${MAKE_VERSION} < 20251111 +.if ${.MAKE.VERSION} < 20251111 M_sh1 = sh .else M_sh1 = sh1 .endif # AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:${M_sh1:Ush}:[0]:N* found*:[@]:C,[()],,g +M_type = @x@(${_type_sh:Utype} $x) 2> /dev/null; echo;@:${M_sh1:Ush}:[0]:N* found*:[@]:C,[()],,g M_whence = ${M_type}:M/*:[1] # produce similar output to jot(1) or seq(1) @@ -98,7 +94,7 @@ M_JOT = [1]:@x@i=1;while [ $$$$i -le $$x ]; do echo $$$$i; i=$$$$((i + 1)); done .endif # ${LIST:${M_RANGE}} is 1 2 3 4 5 if LIST has 5 words -.if ${MAKE_VERSION} < 20170130 +.if ${.MAKE.VERSION} < 20170130 M_RANGE = [#]:${M_JOT} .else M_RANGE = range @@ -108,7 +104,7 @@ M_RANGE = range M_P2V = tu:C,[./-],_,g # convert path to absolute -.if ${MAKE_VERSION} < 20100414 +.if ${.MAKE.VERSION} < 20100414 M_tA = C,.*,('cd' & \&\& 'pwd') 2> /dev/null || echo &,:sh .else M_tA = tA @@ -117,7 +113,7 @@ M_tA = tA # absoulte path to what we are reading. _PARSEDIR = ${.PARSEDIR:${M_tA}} -.if ${MAKE_VERSION} >= 20170130 +.if ${.MAKE.VERSION} >= 20170130 # M_cmpv allows comparing dotted versions like 3.1.2 # ${3.1.2:L:${M_cmpv}} -> 3001002 # we use big jumps to handle 3 digits per dot: @@ -132,7 +128,7 @@ M_cmpv = S,., ,g:C,^0*([0-9]),\1,:_:range:@i@+ $${_:[-$$i]} \* $${M_cmpv.units:[ M_M.M.P_VERSION = L:@v@$${MAJOR MINOR PATCH:L:@t@$${$$v_$$t_VERSION:U0}@}@:ts. # numeric sort -.if ${MAKE_VERSION} < 20210803 +.if ${.MAKE.VERSION} < 20210803 M_On = O M_Onr = O .else |
