From 8eadeb4adeabffe25df5cbfaaa69f7f9b1f362ae Mon Sep 17 00:00:00 2001 From: Soren Brinkmann Date: Thu, 9 Jun 2016 13:36:27 -0700 Subject: [PATCH] build_macros: Add 'add_define_val' macro Add a convenience macro to add a build definition with a value. Signed-off-by: Soren Brinkmann --- make_helpers/build_macros.mk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk index 5171ff00..19b88ad5 100644 --- a/make_helpers/build_macros.mk +++ b/make_helpers/build_macros.mk @@ -68,6 +68,13 @@ define add_define DEFINES += -D$(1)$(if $(value $(1)),=$(value $(1)),) endef +# Convenience function for adding build definitions +# $(eval $(call add_define_val,FOO,BAR)) will have: +# -DFOO=BAR +define add_define_val + DEFINES += -D$(1)=$(2) +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 -- 2.30.2