[CRIU] [PATCH v3] make: fix blob dependencies
    Kinsbursky Stanislav 
    skinsbursky at openvz.org
       
    Tue May 29 12:16:02 EDT 2012
    
    
  
From: Stanislav Kinsbursky <skinsbursky at openvz.org>
v3:
1) "crtools" ($(PROGRAM)) 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 |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)
-------------- next part --------------
diff --git a/Makefile b/Makefile
index 52abbbd..13ecd34 100644
--- a/Makefile
+++ b/Makefile
@@ -61,9 +61,13 @@ DEPS		:= $(patsubst %.o,%.d,$(OBJS))
 include Makefile.syscall
 include Makefile.pie
 
-.PHONY: all test-legacy zdtm test rebuild clean distclean tags cscope docs help
+.PHONY: all test-legacy zdtm test rebuild clean distclean tags cscope	\
+	docs help pie
 
-all: $(PROGRAM)
+all: pie
+	$(Q) $(MAKE) $(PROGRAM)
+
+pie: $(PIE-GEN)
 
 %.o: %.c
 	$(E) "  CC      " $@
@@ -81,16 +85,14 @@ all: $(PROGRAM)
 	$(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: $(PROGRAM)
+test-legacy: all
 	$(Q) $(MAKE) -C test/legacy all
 
-zdtm: $(PROGRAM)
+zdtm: all
 	$(Q) $(MAKE) -C test/zdtm all
 
 test: zdtm
@@ -148,18 +150,14 @@ 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	:= $(PROGRAM)
+.DEFAULT_GOAL	:= all
 
 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