[CRIU] [PATCH 1/2] build/nmk: define map and newline

Dmitry Safonov dsafonov at virtuozzo.com
Fri Feb 19 05:02:50 PST 2016


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 <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 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 a0279d0..88cc774 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 \n
+
+
+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)$(\n))
+
 #
 # Footer.
 $(__nmk_dir)scripts/msg.mk:
-- 
2.7.1



More information about the CRIU mailing list