mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 17:14:28 +00:00
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! travis-ci: success for More polishing for compel cli Signed-off-by: Kir Kolyshkin <kir@openvz.org> Acked-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
67 lines
2.5 KiB
Text
67 lines
2.5 KiB
Text
COMPEL_BIN := $(SRC_DIR)/compel/compel-host
|
|
export COMPEL_BIN
|
|
|
|
COMPEL_VERSION_HEADER := compel/include/version.h
|
|
|
|
$(COMPEL_VERSION_HEADER): $(SRC_DIR)/Makefile.versions
|
|
$(call msg-gen, $(COMPEL_VERSION_HEADER))
|
|
$(Q) echo "/* Autogenerated, do not edit */" > $(COMPEL_VERSION_HEADER)
|
|
$(Q) echo "#ifndef COMPEL_SO_VERSION_H__" >> $(COMPEL_VERSION_HEADER)
|
|
$(Q) echo "#define COMPEL_SO_VERSION_H__" >> $(COMPEL_VERSION_HEADER)
|
|
$(Q) echo "#define COMPEL_SO_VERSION \"$(COMPEL_SO_VERSION)\"" >> $(COMPEL_VERSION_HEADER)
|
|
$(Q) echo "#define COMPEL_SO_VERSION_MAJOR " $(COMPEL_SO_VERSION_MAJOR) >> $(COMPEL_VERSION_HEADER)
|
|
$(Q) echo "#define COMPEL_SO_VERSION_MINOR " $(COMPEL_SO_VERSION_MINOR) >> $(COMPEL_VERSION_HEADER)
|
|
$(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/include/asm:
|
|
$(call msg-gen, $@)
|
|
$(Q) ln -s ../arch/$(ARCH)/src/lib/include $@
|
|
|
|
compel-deps += compel/include/asm
|
|
compel-deps += $(COMPEL_VERSION_HEADER)
|
|
compel-deps += $(CONFIG_HEADER)
|
|
compel-deps += include/common/asm
|
|
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
|
|
$(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-deps) .FORCE
|
|
$(Q) $(MAKE) $(build)=compel/plugins $@
|
|
|
|
compel/plugins/shmem.built-in.o: $(compel-deps) .FORCE
|
|
$(Q) $(MAKE) $(build)=compel/plugins $@
|
|
|
|
compel/compel: compel/built-in.o compel/$(LIBCOMPEL_A) | $(compel-deps)
|
|
$(call msg-link, $@)
|
|
$(Q) $(CC) $(CFLAGS) $^ $(WRAPFLAGS) $(LDFLAGS) -rdynamic -o $@
|
|
|
|
#
|
|
# And compel library.
|
|
LIBCOMPEL_SO_CFLAGS += $(CFLAGS) -rdynamic -Wl,-soname,$(LIBCOMPEL_SO).$(COMPEL_SO_VERSION_MAJOR)
|
|
compel/$(LIBCOMPEL_SO): compel/$(LIBCOMPEL_A)
|
|
$(call msg-link, $@)
|
|
$(Q) $(CC) -shared $(LIBCOMPEL_SO_CFLAGS) -o $@ -Wl,--whole-archive $^ -Wl,--no-whole-archive $(LDFLAGS)
|
|
|
|
compel-install-targets += compel/$(LIBCOMPEL_SO)
|
|
compel-install-targets += compel/compel
|
|
compel-install-targets += $(compel-plugins)
|