[CRIU] [PATCH 05/22] compel: Rename shipped library to libcompel.a

Cyrill Gorcunov gorcunov at openvz.org
Wed Oct 19 12:21:20 PDT 2016


And don't forget to remove generated config.h

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile        |  5 +++--
 Makefile.compel | 24 ++++++++++++++++--------
 compel/Makefile |  1 +
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/Makefile b/Makefile
index 803b3bfc41a1..457577a02ea5 100644
--- a/Makefile
+++ b/Makefile
@@ -229,9 +229,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/compel-host $(VERSION_HEADER) .FORCE
+criu/%: images/built-in.o compel/plugins/std.built-in.o compel/libcompel.a compel/compel-host $(VERSION_HEADER) .FORCE
 	$(Q) $(MAKE) $(build)=criu $@
-criu: images/built-in.o compel/plugins/std.built-in.o compel/compel-host $(SOCCR_A) $(VERSION_HEADER)
+criu: images/built-in.o compel/plugins/std.built-in.o compel/libcompel.a compel/compel-host $(SOCCR_A) $(VERSION_HEADER)
 	$(Q) $(MAKE) $(build)=criu all
 .PHONY: criu
 
@@ -272,6 +272,7 @@ mrproper: subclean
 	$(Q) $(RM) $(SOCCR_CONFIG)
 	$(Q) $(RM) $(VERSION_HEADER)
 	$(Q) $(RM) $(COMPEL_VERSION_HEADER)
+	$(Q) $(RM) $(COMPEL_CONFIG_HEADER)
 	$(Q) $(RM) cscope.*
 	$(Q) $(RM) tags TAGS
 .PHONY: mrproper
diff --git a/Makefile.compel b/Makefile.compel
index b76aa44f7c27..fd12f3b761a5 100644
--- a/Makefile.compel
+++ b/Makefile.compel
@@ -1,4 +1,5 @@
-COMPEL_VERSION_HEADER	:= compel/include/version.h
+COMPEL_VERSION_HEADER	:= compel/include/compel/version.h
+COMPEL_CONFIG_HEADER	:= compel/include/compel/config.h
 
 $(COMPEL_VERSION_HEADER): $(SRC_DIR)/Makefile.versions
 	$(call msg-gen, $(COMPEL_VERSION_HEADER))
@@ -11,35 +12,42 @@ $(COMPEL_VERSION_HEADER): $(SRC_DIR)/Makefile.versions
 	$(Q) echo "#define COMPEL_SO_VERSION_SUBLEVEL " $(COMPEL_SO_VERSION_SUBLEVEL)	>> $(COMPEL_VERSION_HEADER)
 	$(Q) echo "#endif /* COMPEL_SO_VERSION_H__ */"					>> $(COMPEL_VERSION_HEADER)
 
+$(COMPEL_CONFIG_HEADER): $(CONFIG_HEADER)
+	$(call msg-gen, $@)
+	$(Q) ln -s $(SRC_DIR)/$^ $@
+
 build-headers-y:
 	$(Q) $(MAKE) $(build)=compel $@
 .PHONY: build-headers-y
 
+compel-prereq	+= $(COMPEL_VERSION_HEADER)
+compel-prereq	+= $(COMPEL_CONFIG_HEADER)
 compel-prereq	+= build-headers-y
+
 #
 # Compel itself.
-compel/%: $(compel-prereq)  $(COMPEL_VERSION_HEADER) $(CONFIG_HEADER) .FORCE
+compel/%: $(compel-prereq) compel/plugins/std.built-in.o .FORCE
 	$(Q) $(MAKE) $(build)=compel $@
 
 #
 # Plugins
-compel/plugins/%: $(compel-prereq)  $(COMPEL_VERSION_HEADER) $(CONFIG_HEADER) .FORCE
+compel/plugins/%: $(compel-prereq) .FORCE
 	$(Q) $(MAKE) $(build)=compel/plugins $@
 
 #
 # GNU make 4.x supports targets matching via wide
 # match targeting, where GNU make 3.x series (used on
 # Travis) is not, so we have to write them here explicitly.
-compel/plugins/std.built-in.o: $(compel-prereq)  $(COMPEL_VERSION_HEADER) .FORCE
+compel/plugins/std.built-in.o: $(compel-prereq) .FORCE
 	$(Q) $(MAKE) $(build)=compel/plugins $@
 
-compel/plugins/shmem.built-in.o: $(compel-prereq)  $(COMPEL_VERSION_HEADER) .FORCE
+compel/plugins/shmem.built-in.o: compel/plugins/std.built-in.o .FORCE
 	$(Q) $(MAKE) $(build)=compel/plugins $@
 
-compel/plugins/fds.built-in.o: $(compel-prereq)  $(COMPEL_VERSION_HEADER) .FORCE
+compel/plugins/fds.built-in.o: compel/plugins/std.built-in.o .FORCE
 	$(Q) $(MAKE) $(build)=compel/plugins $@
 
-compel/compel: compel/built-in.o compel/lib.a $(COMPEL_VERSION_HEADER) | $(compel-prereq)
+compel/compel: compel/built-in.o compel/libcompel.a | $(compel-prereq)
 	$(call msg-link, $@)
 	$(Q) $(CC) $(CFLAGS) $^ $(WRAPFLAGS) $(LDFLAGS) -rdynamic -o $@
 
@@ -47,6 +55,6 @@ compel/compel: compel/built-in.o compel/lib.a $(COMPEL_VERSION_HEADER) | $(compe
 # And compel library.
 LIBCOMPEL_SO		:= libcompel.so
 LIBCOMPEL_SO_CFLAGS	+= $(CFLAGS) -rdynamic -Wl,-soname,$(LIBCOMPEL_SO).$(COMPEL_SO_VERSION_MAJOR)
-compel/$(LIBCOMPEL_SO): compel/lib.a
+compel/$(LIBCOMPEL_SO): compel/libcompel.a
 	$(call msg-link, $@)
 	$(Q) $(CC) -shared $(LIBCOMPEL_SO_CFLAGS) -o $@ -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDFLAGS)
diff --git a/compel/Makefile b/compel/Makefile
index 2464d614b117..f07bb8dad025 100644
--- a/compel/Makefile
+++ b/compel/Makefile
@@ -16,6 +16,7 @@ ccflags-y		+= -fPIC
 ccflags-y		+= -I compel/include/uapi
 ccflags-y		+= -I compel/plugins/include/uapi
 
+lib-name		:= libcompel.a
 lib-y			+= arch/$(ARCH)/src/lib/handle-elf.o
 host-lib-y		+= arch/$(ARCH)/src/lib/handle-elf.o
 lib-y			+= src/lib/handle-elf.o
-- 
2.7.4



More information about the CRIU mailing list