From e85638fd38d98618d865f59897cd979eabbc1ceb Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Fri, 19 Feb 2016 17:34:46 +0300 Subject: [PATCH] build/nmk: define map and newline map is very good at generating rules. Just map gen function to array of it's parameters. Don't forget to eval the result. I'll use it in feature-tests generation and in someday coming compat 32-bit mode - in x86 makefiles. Cc: Cyrill Gorcunov Signed-off-by: Dmitry Safonov Acked-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- scripts/nmk/scripts/msg.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/scripts/nmk/scripts/msg.mk b/scripts/nmk/scripts/msg.mk index a0279d050..74adebb55 100644 --- a/scripts/nmk/scripts/msg.mk +++ b/scripts/nmk/scripts/msg.mk @@ -42,6 +42,17 @@ define msg-build $(E) " BUILD " $(1) endef +define newline + + +endef + +# map funciton: +# $1 - func to call +# $2 - list over which map the $1 func +# result is divided with newlines +map = $(foreach x,$2,$(call $1,$x)$(newline)) + # # Footer. $(__nmk_dir)scripts/msg.mk: