1 # Several "GNU make" functions to evaluate boolean expressions. Valid
2 # boolean values "y" (true) and "n" (false).
4 # Internal helper function: convert "y"/"n" to "y" / empty string.
5 bool_is_true
= $(filter y
,$(1))
7 # $(call bool_not,$(a))
8 bool_not
= $(if
$(call bool_is_true
,$(1)),n
,y
)
10 # $(call bool_or,$(a),$(b))
11 bool_or
= $(if
$(or
$(call bool_is_true
,$(1)),$(call bool_is_true
,$(2))),y
,n
)
13 # $(call bool_and,$(a),$(b))
14 bool_and
= $(if
$(and
$(call bool_is_true
,$(1)),$(call bool_is_true
,$(2))),y
,n
)