[CRIU] [PATCH v5] make: fix blob dependencies

Kinsbursky Stanislav skinsbursky at openvz.org
Thu May 31 07:39:27 EDT 2012


v5:
1) make change directory messages supressed.

v4:
1) Fixed apply conflicts.

v3:
1) "crtools" goal dependences fixed.

v2:
1) wrong "protobuf/tmp.pb-c.h" inclusion removed from cr-dump.c

Without this patch "touch parasite.c" will lead to rebuild of the whole
project.
This patch also introduces "pie" goal as a subsystem. This will be usefull,
when other subsystems will apper, because it allows to build them in parallel.
"all" becomes default goal. This allows to skip deps inclusion for empty,
"all", "zdtm" and "test-legacy" goals.

Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>

---
 Makefile |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/Makefile b/Makefile
index 80ce31a..89e3efa 100644
--- a/Makefile
+++ b/Makefile
@@ -58,17 +58,18 @@ OBJS		+= inotify.o
 
 DEPS		:= $(patsubst %.o,%.d,$(OBJS))
 
+MAKEFLAGS	+= --no-print-directory
+
 include Makefile.syscall
 include Makefile.pie
 
 .PHONY: all test-legacy zdtm test rebuild clean distclean tags cscope	\
-	docs help deps preq
-
-all: deps $(PROGRAM)
+	docs help pie
 
-deps: preq $(DEPS)
+all: pie
+	$(Q) $(MAKE) $(PROGRAM)
 
-preq: $(SYS-OBJ) $(PIE-GEN)
+pie: $(PIE-GEN)
 
 %.o: %.c
 	$(E) "  CC      " $@
@@ -86,11 +87,9 @@ preq: $(SYS-OBJ) $(PIE-GEN)
 	$(E) "  DEP     " $@
 	$(Q) $(CC) -M -MT $@ -MT $(patsubst %.d,%.o,$@) $(CFLAGS) $< -o $@
 
-$(DEPS) $(OBJS): $(SYS-OBJ) $(PIE-GEN)
-
-$(PROGRAM): $(OBJS)
+$(PROGRAM): $(OBJS) $(LIBS) $(SYS-OBJ) 
 	$(E) "  LINK    " $@
-	$(Q) $(CC) $(CFLAGS) $(OBJS) $(LIBS) $(SYS-OBJ) -o $@
+	$(Q) $(CC) $(CFLAGS) $^ -o $@
 
 test-legacy: all
 	$(Q) $(MAKE) -C test/legacy all
@@ -153,7 +152,7 @@ help:
 	$(E) '      rebuild         - Force-rebuild of [*] targets'
 	$(E) '      test            - Run zdtm test-suite'
 
-deps-targets := $(OBJS) $(patsubst %.o,%.s,$(OBJS)) $(patsubst %.o,%.i,$(OBJS)) $(PROGRAM) zdtm test-legacy
+deps-targets := $(OBJS) $(patsubst %.o,%.s,$(OBJS)) $(patsubst %.o,%.i,$(OBJS)) $(PROGRAM)
 
 .DEFAULT_GOAL	:= all
 
@@ -161,10 +160,6 @@ ifneq ($(filter $(deps-targets), $(MAKECMDGOALS)),)
 	INCDEPS := 1
 endif
 
-ifeq ($(MAKECMDGOALS),)
-	INCDEPS := 1
-endif
-
 ifeq ($(INCDEPS),1)
 -include $(DEPS)
 endif



More information about the CRIU mailing list