mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
135 lines
3.6 KiB
Makefile
135 lines
3.6 KiB
Makefile
# here is a workaround for a bug in libnl-3:
|
|
# 6a8d90f5fec4 "attr: Allow attribute type 0"
|
|
WRAPFLAGS += -Wl,--wrap=nla_parse,--wrap=nlmsg_parse
|
|
|
|
ARCH_DIR := criu/arch/$(SRCARCH)
|
|
PIE_DIR := criu/pie
|
|
export ARCH_DIR PIE_DIR
|
|
|
|
#
|
|
# General flags.
|
|
ccflags-y += -fno-strict-aliasing
|
|
ccflags-y += -iquote $(SRC_DIR)/criu/include
|
|
ccflags-y += -iquote $(SRC_DIR)/include
|
|
ccflags-y += -iquote $(SRC_DIR)/images
|
|
ccflags-y += -iquote $(SRC_DIR)/criu/pie
|
|
ccflags-y += -iquote $(SRC_DIR)/$(ARCH_DIR)
|
|
ccflags-y += -iquote $(SRC_DIR)/$(ARCH_DIR)/include
|
|
ccflags-y += -iquote $(SRC_DIR)/
|
|
ccflags-y += -I/usr/include/libnl3
|
|
ccflags-y += -I compel/include/uapi
|
|
ccflags-y += -I compel/plugins/include/uapi
|
|
|
|
export ccflags-y
|
|
|
|
ifeq ($(GMON),1)
|
|
CFLAGS += -pg
|
|
GMONLDOPT := -pg
|
|
endif
|
|
|
|
# msg-* printing
|
|
include $(__nmk_dir)msg.mk
|
|
|
|
#
|
|
# Needed libraries checks
|
|
include $(SRC_DIR)/criu/Makefile.packages
|
|
|
|
##
|
|
## System calls library.
|
|
#ifeq ($(ARCH),x86)
|
|
## Do not need 32-bit compatible syscall lib compiled in criu
|
|
#SYSCALL-LIB := $(ARCH_DIR)/syscalls-64.built-in.o
|
|
#else
|
|
#SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
|
|
#endif
|
|
#syscalls_lib:
|
|
# $(Q) $(MAKE) $(call build-as,Makefile.syscalls,$(ARCH_DIR)) all
|
|
.PHONY: syscalls_lib
|
|
|
|
#
|
|
# Architecture dependent part.
|
|
ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
|
|
$(ARCH-LIB): syscalls_lib
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) all
|
|
|
|
#
|
|
# PIE library code.
|
|
criu/pie/native.lib.a: $(ARCH-LIB)
|
|
$(Q) $(MAKE) $(call build-as,Makefile.library,criu/pie) all
|
|
|
|
#
|
|
# PIE code blobs themseves.
|
|
pie: criu/pie/native.lib.a
|
|
$(Q) $(MAKE) $(build)=criu/pie all
|
|
.PHONY: pie
|
|
|
|
criu/pie/%: pie
|
|
@true
|
|
|
|
#
|
|
# CRIU executable
|
|
PROGRAM-BUILTINS += criu/pie/native.lib.a
|
|
PROGRAM-BUILTINS += images/built-in.o
|
|
PROGRAM-BUILTINS += $(obj)/built-in.o
|
|
PROGRAM-BUILTINS += $(ARCH-LIB)
|
|
PROGRAM-BUILTINS += soccr/libsoccr.a
|
|
|
|
$(obj)/built-in.o: pie
|
|
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) all
|
|
|
|
$(obj)/Makefile:
|
|
@true
|
|
|
|
$(obj)/%: pie
|
|
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) $@
|
|
|
|
$(obj)/criu: $(PROGRAM-BUILTINS)
|
|
$(call msg-link, $@)
|
|
$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(WRAPFLAGS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
|
|
|
|
|
|
#
|
|
# Clean the most, except generated c files
|
|
subclean:
|
|
$(Q) $(RM) $(obj)/*.{gcda,gcno,gcov}
|
|
$(Q) $(RM) $(obj)/pie/*.{gcda,gcno,gcov}
|
|
$(Q) $(RM) -r $(obj)/gcov
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) clean
|
|
$(Q) $(MAKE) $(call build-as,Makefile.library,$(PIE_DIR)) clean
|
|
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) clean
|
|
$(Q) $(MAKE) $(build)=$(PIE_DIR) clean
|
|
.PHONY: subclean
|
|
cleanup-y += $(obj)/criu
|
|
clean: subclean
|
|
|
|
#
|
|
# Delete all generated files
|
|
subproper:
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) mrproper
|
|
$(Q) $(MAKE) $(call build-as,Makefile.library,$(PIE_DIR)) mrproper
|
|
$(Q) $(MAKE) $(call build-as,Makefile.crtools,criu) mrproper
|
|
$(Q) $(MAKE) $(build)=$(PIE_DIR) mrproper
|
|
.PHONY: subproper
|
|
mrproper: subproper
|
|
|
|
UAPI_HEADERS := $(SRC_DIR)/criu/include/criu-plugin.h
|
|
UAPI_HEADERS += $(SRC_DIR)/criu/include/criu-log.h
|
|
|
|
install: $(obj)/criu
|
|
$(E) " INSTALL " $(obj)/criu
|
|
$(Q) mkdir -p $(DESTDIR)$(SBINDIR)
|
|
$(Q) install -m 755 $(obj)/criu $(DESTDIR)$(SBINDIR)
|
|
$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)/criu/
|
|
$(Q) install -m 644 $(UAPI_HEADERS) $(DESTDIR)$(INCLUDEDIR)/criu/
|
|
$(Q) mkdir -p $(DESTDIR)$(LIBEXECDIR)/criu/scripts
|
|
$(Q) install -m 755 $(SRC_DIR)/scripts/systemd-autofs-restart.sh $(DESTDIR)$(LIBEXECDIR)/criu/scripts
|
|
.PHONY: install
|
|
|
|
uninstall:
|
|
$(E) " UNINSTALL" criu
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(SBINDIR)/,criu)
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(INCLUDEDIR)/criu/,$(notdir $(UAPI_HEADERS)))
|
|
$(Q) $(RM) $(addprefix $(DESTDIR)$(LIBEXECDIR)/criu/scripts/,systemd-autofs-restart.sh)
|
|
.PHONY: uninstall
|
|
|
|
all-y += check-packages $(obj)/criu
|