Joey Armstrong | 04cdd9f | 2023-06-09 15:18:23 -0400 | [diff] [blame] | 1 | ## ----------------------------------------------------------------------- |
| 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 | ## ----------------------------------------------------------------------- |
| 6 | boolean = $(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 | ## ----------------------------------------------------------------------- |
| 16 | not = $(strip \ |
| 17 | $(foreach true-false\ |
| 18 | ,$(info true-false=$(true-false))$(strip $(call boolean,$(1)))\ |
| 19 | $(subst true,$(null),$(true-false))\ |
| 20 | )\ |
| 21 | ) |