2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

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: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Dmitry Safonov
2016-02-19 17:34:46 +03:00
committed by Pavel Emelyanov
parent ab04ddc567
commit e85638fd38

View File

@@ -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: