[CRIU] [PATCH 3/3] make: prepare crtools build for submake calls
Kinsbursky Stanislav
skinsbursky at openvz.org
Tue May 29 10:33:16 EDT 2012
The reason for this patch is that only phony goal can depend on phony targets.
But with protobuf we will have to execute phony targets prior to main target
build.
So, this patch set add few new goals and dependences:
1) "all" become default goal.
2) new goals "deps" and "preq" introduced.
3) "all" depends on "deps" and "crtools".
4) All global goals like "zdtm" and "test-legacy" now depends on "all".
Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
---
Makefile | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 52abbbd..80ce31a 100644
--- a/Makefile
+++ b/Makefile
@@ -61,9 +61,14 @@ 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 deps preq
-all: $(PROGRAM)
+all: deps $(PROGRAM)
+
+deps: preq $(DEPS)
+
+preq: $(SYS-OBJ) $(PIE-GEN)
%.o: %.c
$(E) " CC " $@
@@ -87,10 +92,10 @@ $(PROGRAM): $(OBJS)
$(E) " LINK " $@
$(Q) $(CC) $(CFLAGS) $(OBJS) $(LIBS) $(SYS-OBJ) -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
@@ -150,7 +155,7 @@ help:
deps-targets := $(OBJS) $(patsubst %.o,%.s,$(OBJS)) $(patsubst %.o,%.i,$(OBJS)) $(PROGRAM) zdtm test-legacy
-.DEFAULT_GOAL := $(PROGRAM)
+.DEFAULT_GOAL := all
ifneq ($(filter $(deps-targets), $(MAKECMDGOALS)),)
INCDEPS := 1
More information about the CRIU
mailing list