[CRIU] [PATCH] test/build: remove makefile built-in references

Dmitry Safonov dsafonov at virtuozzo.com
Tue Feb 16 07:12:58 PST 2016


As now we have in scripts/nmk/scripts/include.mk
MAKEFLAGS, which contain -R flag, we should avoid using built-ins:
(from man 1 make):
       -R, --no-builtin-variables
            Don't define any built-in variables.
This patch removes references to COMPILE.c, OUTPUT_OPTION.
I add CPPFLAGS to DEPEND.c which is needed to include
arch/*/include/atomic.h file.

Note: after this patch `make test` still fails, as we need to
convert built-in rules to defined rules from dependency files.
(now still left to -include $(LIBDEP) which confuse make)

Cc: Cyrill Gorcunov <gorcunov at openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
Maybe I should use the new build process a little more in this patch.

 test/zdtm/Makefile.inc             | 3 +++
 test/zdtm/lib/Makefile             | 3 +--
 test/zdtm/live/static/Makefile     | 1 -
 test/zdtm/live/streaming/Makefile  | 1 -
 test/zdtm/live/transition/Makefile | 1 -
 5 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/test/zdtm/Makefile.inc b/test/zdtm/Makefile.inc
index 5e0d420..be66f2a 100644
--- a/test/zdtm/Makefile.inc
+++ b/test/zdtm/Makefile.inc
@@ -31,6 +31,9 @@ endif
 
 CPPFLAGS += -iquote $(LIBDIR)/arch/$(SRCARCH)/include
 
+DEPEND.c = $(CC) $(CFLAGS) $(CPPFLAGS) -MM -MP $(TARGET_ARCH) -c
+OUTPUT_OPTION = -o $@
+
 ifeq ($(strip $(V)),)
 	E = @echo
 	Q = @
diff --git a/test/zdtm/lib/Makefile b/test/zdtm/lib/Makefile
index 592d934..ddbdb50 100644
--- a/test/zdtm/lib/Makefile
+++ b/test/zdtm/lib/Makefile
@@ -11,7 +11,6 @@ LIBSRC	= datagen.c msg.c parseargs.c test.c streamutil.c lock.c ns.c tcp.c fs.c
 LIBOBJ	= $(LIBSRC:%.c=%.o)
 LIBDEP	= $(LIBSRC:%.c=%.d)
 
-DEPEND.c = $(COMPILE.c) -MM -MP
 %.d:	%.c
 	$(DEPEND.c) $(OUTPUT_OPTION) $<
 
@@ -20,7 +19,7 @@ all:	$(LIB)
 install: all
 .PHONY: all install
 
-$(LIB):	$(LIBOBJ)
+$(LIB):	$(LIBDEP) $(LIBOBJ)
 	$(Q) ar rv $@ $^
 
 clean:
diff --git a/test/zdtm/live/static/Makefile b/test/zdtm/live/static/Makefile
index 06e5985..ab8cbe2 100644
--- a/test/zdtm/live/static/Makefile
+++ b/test/zdtm/live/static/Makefile
@@ -256,7 +256,6 @@ OUT	= $(TST:%=%.out)
 STATE	= $(TST_STATE:%=%.state)
 STATE_OUT	= $(TST_STATE:%=%.out)
 
-DEPEND.c = $(COMPILE.c) -MM -MP
 %.d:	%.c
 	$(DEPEND.c) $(OUTPUT_OPTION) $<
 
diff --git a/test/zdtm/live/streaming/Makefile b/test/zdtm/live/streaming/Makefile
index e65e3fd..5ae19a2 100644
--- a/test/zdtm/live/streaming/Makefile
+++ b/test/zdtm/live/streaming/Makefile
@@ -27,7 +27,6 @@ DEP	= $(SRC:%.c=%.d)
 PID	= $(TST:%=%.pid)
 OUT	= $(TST:%=%.out)
 
-DEPEND.c = $(COMPILE.c) -MM -MP
 %.d:	%.c
 	$(DEPEND.c) $(OUTPUT_OPTION) $<
 
diff --git a/test/zdtm/live/transition/Makefile b/test/zdtm/live/transition/Makefile
index c791e62..efb0920 100644
--- a/test/zdtm/live/transition/Makefile
+++ b/test/zdtm/live/transition/Makefile
@@ -25,7 +25,6 @@ DEP	= $(SRC:%.c=%.d)
 PID	= $(TST:%=%.pid)
 OUT	= $(TST:%=%.out)
 
-DEPEND.c = $(COMPILE.c) -MM -MP
 %.d:	%.c
 	$(DEPEND.c) $(OUTPUT_OPTION) $<
 
-- 
2.7.1



More information about the CRIU mailing list