[CRIU] [PATCH 16/24] Makefile: untangle criu deps
Kir Kolyshkin
kir at openvz.org
Sat Dec 17 03:22:09 PST 2016
Build of criu binary depends on many other things that needs to be built
before it. Let's clean these deps a bit by using criu-deps variable.
This also removes wrong "$(VERSION_HEADER): include/common/asm"
dependency -- one can certainly succeed in generating
criu/include/version.h file without creating include/common/asm
symlink fist!
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
Makefile | 11 ++++++++---
Makefile.compel | 3 +++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 03c3dce..1314e90 100644
--- a/Makefile
+++ b/Makefile
@@ -173,12 +173,15 @@ endif
$(Q) echo "#define CRIU_GITID \"$(GITID)\"" >> $@
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $@
+criu-deps += $(VERSION_HEADER)
+
#
# Setup proper link for asm headers in common code.
include/common/asm: include/common/arch/$(ARCH)/asm
$(call msg-gen, $@)
$(Q) ln -s ./arch/$(ARCH)/asm $@
-$(VERSION_HEADER): include/common/asm
+
+criu-deps += include/common/asm
#
# Configure variables.
@@ -194,6 +197,7 @@ endif
# Protobuf images first, they are not depending
# on anything else.
$(eval $(call gen-built-in,images))
+criu-deps += images/built-in.o
.PHONY: .FORCE
@@ -213,6 +217,7 @@ soccr/%: $(SOCCR_CONFIG) .FORCE
soccr/built-in.o: $(SOCCR_CONFIG) .FORCE
$(Q) $(MAKE) $(build)=soccr all
$(SOCCR_A): |soccr/built-in.o
+criu-deps += $(SOCCR_A)
#
# CRIU building done in own directory
@@ -222,9 +227,9 @@ $(SOCCR_A): |soccr/built-in.o
#
# But note that we're already included
# the nmk so we can reuse it there.
-criu/%: images/built-in.o compel/plugins/std.built-in.o compel/libcompel.a compel/compel-host-bin $(VERSION_HEADER) .FORCE
+criu/%: $(criu-deps) .FORCE
$(Q) $(MAKE) $(build)=criu $@
-criu: images/built-in.o compel/plugins/std.built-in.o compel/libcompel.a compel/compel-host-bin $(SOCCR_A) $(VERSION_HEADER)
+criu: $(criu-deps)
$(Q) $(MAKE) $(build)=criu all
.PHONY: criu
diff --git a/Makefile.compel b/Makefile.compel
index 46a3b52..3e7a174 100644
--- a/Makefile.compel
+++ b/Makefile.compel
@@ -27,12 +27,15 @@ compel-plugins += compel/plugins/std.built-in.o
LIBCOMPEL_SO := libcompel.so
LIBCOMPEL_A := libcompel.a
export LIBCOMPEL_SO LIBCOMPEL_A
+criu-deps += compel/$(LIBCOMPEL_A)
#
# Compel itself.
compel/%: $(compel-deps) $(compel-plugins) .FORCE
$(Q) $(MAKE) $(build)=compel $@
+criu-deps += compel/compel-host-bin
+
#
# Plugins
compel/plugins/%: $(compel-deps) .FORCE
--
2.7.4
More information about the CRIU
mailing list