blob: 31fc73636b0bb3d542d953d5874974a1f74236c8 [file] [log] [blame]
Joey Armstrong04cdd9f2023-06-09 15:18:23 -04001## -----------------------------------------------------------------------
2## Intent: Cast value into a boolean string.
3## NOTE: : Careful with line comment placement, when octolthorp is indented
4## in a makefile return value will have whitespace appended.
5## -----------------------------------------------------------------------
6boolean = $(if $(strip $($(1))),false,true)# trailing whitespace is bad here
7
8## -----------------------------------------------------------------------
9## Intet: Negate input value for conditional use.
10## Return success when input value is null.
11## Usage:
12## $(info ** defined[true] = $(call not,value))
13## $(info ** defined[false] = $(call not,$(null)))
14## $(if $(call not,varname),$(error varname= is not set))
15## -----------------------------------------------------------------------
16not = $(strip \
17 $(foreach true-false\
18 ,$(info true-false=$(true-false))$(strip $(call boolean,$(1)))\
19 $(subst true,$(null),$(true-false))\
20 )\
21)