From f8dfdd9ffb8babdb0f4095d7b5e64d7e9c80914a Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 24 Feb 2016 20:25:00 +0300 Subject: [PATCH] build: Fix criu depdendent parts linking When link criu we make sure that all underlied systems are up to day: images, syscalls, pie part. Thus provide own targets for them and link on a final pass. This should fix the problem when some file in images|syscalls|pie are changed but criu itself is not rebuilt and relinked. NB: Need to revisit the config/version/feature-test generations too. Signed-off-by: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- criu/Makefile | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/criu/Makefile b/criu/Makefile index 7d01bace9..e9a1f91da 100644 --- a/criu/Makefile +++ b/criu/Makefile @@ -99,14 +99,16 @@ config: $(VERSION_HEADER) # # System calls library. SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o -$(SYSCALL-LIB): config +syscalls_lib: config $(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all +.PHONY: syscalls_lib # # Architecture dependant part. ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o -$(ARCH-LIB): config $(SYSCALL-LIB) - $(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) $@ +arch_lib: config syscalls_lib + $(Q) $(MAKE) $(call build-as,Makefile,$(ARCH_DIR)) all +.PHONY: arch_lib # # piegen tool needed for PIE code. @@ -122,7 +124,7 @@ endif # # PIE library code. -pie/lib.a: $(ARCH-LIB) $(SYSCALL-LIB) +pie/lib.a: arch_lib syscalls_lib $(Q) $(MAKE) $(call build-as,Makefile.library,pie) all # @@ -137,8 +139,7 @@ PROGRAM-BUILTINS += ../images/built-in.o PROGRAM-BUILTINS += built-in.o PROGRAM-BUILTINS += pie/lib.a PROGRAM-BUILTINS += $(SYSCALL-LIB) - -LIBS += arch/$(ARCH)/crtools.built-in.o +PROGRAM-BUILTINS += $(ARCH-LIB) built-in.o: pie $(Q) $(MAKE) $(call build-as,Makefile.crtools,.) all