diff options
author | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-05-23 23:45:01 +0900 |
---|---|---|
committer | Masahiro Yamada <yamada.masahiro@socionext.com> | 2017-05-23 23:57:49 +0900 |
commit | be4cd40e8b91cb7f90109fb254c5540d57b12b0a (patch) | |
tree | 97b9a89174eed144414b05d41154b6770949107b | |
parent | 727a68b8ef02f48316ef13903a63af2638f6bbd3 (diff) |
Build: fix assert_boolean implementation
The current assert_boolean does not work with variables assigned with
'=' flavor instead of ':='.
For example,
FOO = $(BAR)
BAR := 1
Here, $(value FOO) is evaluated to $(BAR), not 1. This is not what
we expect. While I am here, I simplified the implementation.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
-rw-r--r-- | make_helpers/build_macros.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 36f220e0..34d82c9a 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -54,7 +54,7 @@ endef # Convenience function for verifying option has a boolean value # $(eval $(call assert_boolean,FOO)) will assert FOO is 0 or 1 define assert_boolean - $(and $(patsubst 0,,$(value $(1))),$(patsubst 1,,$(value $(1))),$(error $(1) must be boolean)) + $(if $(filter-out 0 1,$($1)),$(error $1 must be boolean)) endef 0-9 := 0 1 2 3 4 5 6 7 8 9 |