Commit e85638fd authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Pavel Emelyanov

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 <gorcunov@openvz.org>
Signed-off-by: 's avatarDmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent ab04ddc5
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment