[CRIU] [PATCHv3 1/3] nmk/build: separate msg-* printing from .mk files

Dmitry Safonov dsafonov at virtuozzo.com
Thu Feb 18 01:36:04 PST 2016


Some places in criu need printing support, but do not need
common variables redefining, therefore separate msg printing
to msg.mk

Acked-by: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
 scripts/nmk/scripts/include.mk | 42 ++---------------------------------
 scripts/nmk/scripts/msg.mk     | 50 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 40 deletions(-)
 create mode 100644 scripts/nmk/scripts/msg.mk

diff --git a/scripts/nmk/scripts/include.mk b/scripts/nmk/scripts/include.mk
index 6216fea..c7dd7cc 100644
--- a/scripts/nmk/scripts/include.mk
+++ b/scripts/nmk/scripts/include.mk
@@ -1,47 +1,9 @@
 ifndef ____nmk_defined__include
 
-#
-# Silent make rules.
-ifeq ($(strip $(V)),)
-        E := @echo
-        Q := @
-else
-        E := @\#
-        Q :=
+ifndef ____nmk_defined__msg
+        include $(__nmk_dir)msg.mk
 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
-
 #
 # Common vars.
 SUBARCH := $(shell uname -m | sed       \
diff --git a/scripts/nmk/scripts/msg.mk b/scripts/nmk/scripts/msg.mk
new file mode 100644
index 0000000..a0279d0
--- /dev/null
+++ b/scripts/nmk/scripts/msg.mk
@@ -0,0 +1,50 @@
+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
+
+#
+# Footer.
+$(__nmk_dir)scripts/msg.mk:
+	@true
+____nmk_defined__msg = y
+endif #____nmk_defined__msg
-- 
2.7.1



More information about the CRIU mailing list