mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-24 10:38:06 +00:00
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>
61 lines
837 B
Makefile
61 lines
837 B
Makefile
ifndef ____nmk_defined__msg
|
|
|
|
#
|
|
# Silent make rules.
|
|
ifeq ($(strip $(V)),)
|
|
E := @echo
|
|
Q := @
|
|
else
|
|
E := @\#
|
|
Q :=
|
|
endif
|
|
|
|
export E Q
|
|
|
|
#
|
|
# Message helpers.
|
|
define msg-gen
|
|
$(E) " GEN " $(1)
|
|
endef
|
|
|
|
define msg-clean
|
|
$(E) " CLEAN " $(1)
|
|
endef
|
|
|
|
define msg-cc
|
|
$(E) " CC " $(1)
|
|
endef
|
|
|
|
define msg-dep
|
|
$(E) " DEP " $(1)
|
|
endef
|
|
|
|
define msg-link
|
|
$(E) " LINK " $(1)
|
|
endef
|
|
|
|
define msg-ar
|
|
$(E) " AR " $(1)
|
|
endef
|
|
|
|
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:
|
|
@true
|
|
____nmk_defined__msg = y
|
|
endif #____nmk_defined__msg
|