2013-11-25 20:05:10 +04:00
|
|
|
VERSION_MAJOR := 1
|
2015-12-07 11:29:53 +03:00
|
|
|
VERSION_MINOR := 8
|
2013-02-19 18:14:26 +04:00
|
|
|
VERSION_SUBLEVEL :=
|
|
|
|
VERSION_EXTRA :=
|
|
|
|
VERSION_NAME :=
|
2014-02-05 18:28:00 +04:00
|
|
|
VERSION_SO_MAJOR := 1
|
|
|
|
VERSION_SO_MINOR := 0
|
2013-02-19 18:14:26 +04:00
|
|
|
|
|
|
|
export VERSION_MAJOR VERSION_MINOR VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME
|
2014-02-05 18:28:00 +04:00
|
|
|
export VERSION_SO_MAJOR VERSION_SO_MINOR
|
2013-02-19 18:14:26 +04:00
|
|
|
|
2012-11-22 18:54:21 +04:00
|
|
|
#
|
2013-02-15 23:40:33 +04:00
|
|
|
# FIXME zdtm building procedure requires implicit rules
|
|
|
|
# so I can't use strict make file mode and drop completely
|
|
|
|
# all of implicit rules, so I tuned only .SUFFIXES:
|
|
|
|
#
|
|
|
|
# In future zdtm makefiles need to be fixed and the line below
|
|
|
|
# may be uncommented.
|
2012-11-22 18:54:21 +04:00
|
|
|
#
|
2013-04-23 15:12:46 -07:00
|
|
|
#MAKEFLAGS := -r -R
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2013-02-15 23:40:33 +04:00
|
|
|
#
|
|
|
|
# Common definitions
|
|
|
|
#
|
2012-11-22 18:54:21 +04:00
|
|
|
|
|
|
|
FIND := find
|
|
|
|
CSCOPE := cscope
|
2013-02-07 02:12:23 +04:00
|
|
|
RM := rm -f
|
2013-05-30 13:41:17 +04:00
|
|
|
LD := $(CROSS_COMPILE)ld
|
|
|
|
CC := $(CROSS_COMPILE)gcc
|
|
|
|
NM := $(CROSS_COMPILE)nm
|
2013-01-10 20:12:44 +04:00
|
|
|
SH := bash
|
2012-11-22 18:54:21 +04:00
|
|
|
MAKE := make
|
2013-05-30 13:41:17 +04:00
|
|
|
OBJCOPY := $(CROSS_COMPILE)objcopy
|
2015-09-29 22:26:21 +03:00
|
|
|
HOSTCC ?= gcc
|
|
|
|
HOSTLD ?= ld
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2014-02-07 12:04:42 -05:00
|
|
|
CFLAGS += $(USERCFLAGS)
|
2015-09-29 22:26:21 +03:00
|
|
|
HOSTCFLAGS ?= $(CFLAGS)
|
|
|
|
|
|
|
|
export HOSTCC
|
|
|
|
export HOSTLD
|
|
|
|
export HOSTCFLAGS
|
2014-02-07 12:04:42 -05:00
|
|
|
|
2013-01-24 13:20:57 +04:00
|
|
|
#
|
|
|
|
# Fetch ARCH from the uname if not yet set
|
|
|
|
#
|
|
|
|
ARCH ?= $(shell uname -m | sed \
|
|
|
|
-e s/i.86/i386/ \
|
|
|
|
-e s/sun4u/sparc64/ \
|
|
|
|
-e s/s390x/s390/ \
|
|
|
|
-e s/parisc64/parisc/ \
|
|
|
|
-e s/mips.*/mips/ \
|
|
|
|
-e s/sh[234].*/sh/)
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2013-01-24 13:20:57 +04:00
|
|
|
ifeq ($(ARCH),i386)
|
2014-02-07 12:04:38 -05:00
|
|
|
SRCARCH := x86-32
|
2012-11-22 18:54:21 +04:00
|
|
|
DEFINES := -DCONFIG_X86_32
|
2014-05-26 11:50:12 +04:00
|
|
|
VDSO := y
|
2015-04-22 20:19:59 +03:00
|
|
|
PROTOUFIX := y
|
|
|
|
export PROTOUFIX
|
2012-11-22 18:54:21 +04:00
|
|
|
endif
|
2013-01-24 13:20:57 +04:00
|
|
|
ifeq ($(ARCH),x86_64)
|
2014-02-07 12:04:38 -05:00
|
|
|
SRCARCH := x86
|
2012-11-22 18:54:21 +04:00
|
|
|
DEFINES := -DCONFIG_X86_64
|
2013-01-09 17:08:17 +04:00
|
|
|
LDARCH := i386:x86-64
|
2014-05-26 11:50:12 +04:00
|
|
|
VDSO := y
|
2012-11-22 18:54:21 +04:00
|
|
|
endif
|
2015-06-05 00:04:08 +03:00
|
|
|
ifeq ($(ARCH),ia32)
|
|
|
|
SRCARCH := x86
|
|
|
|
DEFINES := -DCONFIG_X86_32
|
|
|
|
LDARCH := i386
|
|
|
|
ldflags-y += -m elf_i386
|
|
|
|
VDSO := y
|
|
|
|
USERCFLAGS += -m32
|
|
|
|
PROTOUFIX := y
|
|
|
|
export PROTOUFIX ldflags-y
|
|
|
|
endif
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2013-07-10 10:15:54 +04:00
|
|
|
ifeq ($(shell echo $(ARCH) | sed -e 's/arm.*/arm/'),arm)
|
2014-02-07 12:04:40 -05:00
|
|
|
ARMV := $(shell echo $(ARCH) | sed -nr 's/armv([[:digit:]]).*/\1/p; t; i7')
|
2014-02-07 12:04:38 -05:00
|
|
|
SRCARCH := arm
|
2014-02-07 12:04:41 -05:00
|
|
|
DEFINES := -DCONFIG_ARMV$(ARMV)
|
2013-07-10 10:15:54 +04:00
|
|
|
|
2014-12-24 11:42:00 +03:00
|
|
|
USERCFLAGS += -Wa,-mimplicit-it=always
|
|
|
|
|
2013-07-10 10:15:54 +04:00
|
|
|
ifeq ($(ARMV),6)
|
2014-02-07 12:04:43 -05:00
|
|
|
USERCFLAGS += -march=armv6
|
2013-07-10 10:15:54 +04:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(ARMV),7)
|
2014-02-07 12:04:43 -05:00
|
|
|
USERCFLAGS += -march=armv7-a
|
2013-07-10 10:15:54 +04:00
|
|
|
endif
|
2013-01-22 22:53:24 +04:00
|
|
|
endif
|
2014-08-05 16:20:24 -04:00
|
|
|
ifeq ($(ARCH),aarch64)
|
|
|
|
VDSO := y
|
|
|
|
endif
|
2013-01-22 22:53:24 +04:00
|
|
|
|
2015-04-22 20:19:59 +03:00
|
|
|
ifeq ($(SRCARCH),arm)
|
|
|
|
PROTOUFIX := y
|
|
|
|
export PROTOUFIX
|
|
|
|
endif
|
|
|
|
|
2015-04-30 09:57:49 +03:00
|
|
|
#
|
|
|
|
# The PowerPC 64 bits architecture could be big or little endian.
|
|
|
|
# They are handled in the same way.
|
|
|
|
#
|
|
|
|
ifeq ($(shell echo $(ARCH) | sed -e 's/ppc64.*/ppc64/'),ppc64)
|
|
|
|
ifeq ($(ARCH),ppc64)
|
|
|
|
error := $(error ppc64 big endian not yet supported)
|
|
|
|
endif
|
|
|
|
SRCARCH := ppc64
|
|
|
|
DEFINES := -DCONFIG_PPC64
|
|
|
|
LDARCH := powerpc:common64
|
|
|
|
VDSO := y
|
|
|
|
endif
|
|
|
|
|
2014-02-15 03:13:00 +04:00
|
|
|
SRCARCH ?= $(ARCH)
|
2014-02-07 12:04:38 -05:00
|
|
|
LDARCH ?= $(SRCARCH)
|
2013-10-11 10:48:00 +04:00
|
|
|
|
2013-02-15 23:40:31 +04:00
|
|
|
SRC_DIR ?= $(CURDIR)
|
2014-02-07 12:04:38 -05:00
|
|
|
ARCH_DIR := arch/$(SRCARCH)
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2015-04-22 20:19:57 +03:00
|
|
|
export ARCH SRCARCH
|
|
|
|
|
2013-01-14 11:25:43 +04:00
|
|
|
$(if $(wildcard $(ARCH_DIR)),,$(error "The architecture $(ARCH) isn't supported"))
|
|
|
|
|
2015-06-16 12:31:00 +03:00
|
|
|
#
|
|
|
|
# piegen might be disabled by hands. Don't use it until
|
|
|
|
# you know what you're doing.
|
|
|
|
ifneq ($(filter i386 ia32 x86_64 ppc64le, $(ARCH)),)
|
|
|
|
ifneq ($(PIEGEN),no)
|
|
|
|
piegen-y := y
|
|
|
|
export piegen-y
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2013-02-22 18:08:56 +04:00
|
|
|
cflags-y += -iquote include -iquote pie -iquote .
|
|
|
|
cflags-y += -iquote $(ARCH_DIR) -iquote $(ARCH_DIR)/include
|
|
|
|
cflags-y += -fno-strict-aliasing
|
|
|
|
export cflags-y
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2013-12-19 21:35:00 +04:00
|
|
|
LIBS := -lrt -lpthread -lprotobuf-c -ldl
|
2012-11-22 18:54:21 +04:00
|
|
|
|
|
|
|
DEFINES += -D_FILE_OFFSET_BITS=64
|
|
|
|
DEFINES += -D_GNU_SOURCE
|
|
|
|
|
|
|
|
WARNINGS := -Wall
|
|
|
|
|
|
|
|
ifneq ($(WERROR),0)
|
|
|
|
WARNINGS += -Werror
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
DEFINES += -DCR_DEBUG
|
|
|
|
CFLAGS += -O0 -ggdb3
|
|
|
|
else
|
|
|
|
CFLAGS += -O2
|
|
|
|
endif
|
|
|
|
|
2014-02-07 20:46:00 +04:00
|
|
|
ifeq ($(GMON),1)
|
|
|
|
CFLAGS += -pg
|
|
|
|
GMONLDOPT = -pg
|
|
|
|
endif
|
|
|
|
|
2012-11-22 18:54:21 +04:00
|
|
|
CFLAGS += $(WARNINGS) $(DEFINES)
|
2014-02-07 12:04:37 -05:00
|
|
|
SYSCALL-LIB := $(ARCH_DIR)/syscalls.built-in.o
|
|
|
|
ARCH-LIB := $(ARCH_DIR)/crtools.built-in.o
|
2014-02-05 18:28:00 +04:00
|
|
|
CRIU-SO := libcriu
|
|
|
|
CRIU-LIB := lib/$(CRIU-SO).so
|
2015-07-24 01:47:00 +03:00
|
|
|
CRIU-INC := lib/criu.h include/criu-plugin.h include/criu-log.h protobuf/rpc.proto
|
2015-06-16 12:31:00 +03:00
|
|
|
ifeq ($(piegen-y),y)
|
|
|
|
piegen := pie/piegen/piegen
|
2015-06-05 00:04:02 +03:00
|
|
|
endif
|
2012-11-22 18:54:21 +04:00
|
|
|
|
2014-02-15 03:13:00 +04:00
|
|
|
export CC MAKE CFLAGS LIBS SRCARCH DEFINES MAKEFLAGS CRIU-SO
|
2013-02-15 23:40:28 +04:00
|
|
|
export SRC_DIR SYSCALL-LIB SH RM ARCH_DIR OBJCOPY LDARCH LD
|
2014-05-22 11:18:02 -07:00
|
|
|
export USERCFLAGS
|
2013-02-22 18:08:56 +04:00
|
|
|
export cflags-y
|
2014-05-26 11:50:12 +04:00
|
|
|
export VDSO
|
2011-09-23 12:00:45 +04:00
|
|
|
|
2014-02-07 12:04:35 -05:00
|
|
|
include Makefile.inc
|
|
|
|
include Makefile.config
|
2013-02-11 19:24:06 +04:00
|
|
|
include scripts/Makefile.version
|
2013-02-15 23:40:28 +04:00
|
|
|
include scripts/Makefile.rules
|
2013-02-15 23:40:33 +04:00
|
|
|
|
|
|
|
.SUFFIXES:
|
|
|
|
|
2013-02-15 23:40:28 +04:00
|
|
|
#
|
|
|
|
# shorthand
|
2013-04-23 15:12:46 -07:00
|
|
|
build := -r -R -f scripts/Makefile.build makefile=Makefile obj
|
|
|
|
build-crtools := -r -R -f scripts/Makefile.build makefile=Makefile.crtools obj
|
2013-02-11 19:24:06 +04:00
|
|
|
|
2013-04-30 20:17:55 +04:00
|
|
|
PROGRAM := criu
|
2011-09-23 12:00:45 +04:00
|
|
|
|
2012-07-28 09:08:16 +04:00
|
|
|
.PHONY: all zdtm test rebuild clean distclean tags cscope \
|
2014-12-31 14:06:50 +02:00
|
|
|
docs help pie protobuf $(ARCH_DIR) clean-built lib crit
|
2012-05-29 18:33:00 +04:00
|
|
|
|
2012-12-25 22:43:14 +04:00
|
|
|
ifeq ($(GCOV),1)
|
|
|
|
%.o $(PROGRAM): override CFLAGS += --coverage
|
|
|
|
endif
|
|
|
|
|
2015-01-19 18:38:00 +03:00
|
|
|
all: config pie $(VERSION_HEADER) $(CRIU-LIB)
|
|
|
|
$(Q) $(MAKE) $(PROGRAM)
|
|
|
|
$(Q) $(MAKE) crit
|
2012-05-29 18:33:00 +04:00
|
|
|
|
2013-02-15 23:40:29 +04:00
|
|
|
protobuf/%::
|
|
|
|
$(Q) $(MAKE) $(build)=protobuf $@
|
|
|
|
protobuf:
|
|
|
|
$(Q) $(MAKE) $(build)=protobuf all
|
|
|
|
|
2014-05-26 15:02:56 +04:00
|
|
|
$(ARCH_DIR)/%:: protobuf config
|
2014-02-07 12:04:37 -05:00
|
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) $@
|
2014-05-26 15:02:56 +04:00
|
|
|
$(ARCH_DIR): protobuf config
|
2014-02-07 12:04:37 -05:00
|
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) all
|
2013-02-15 23:40:28 +04:00
|
|
|
|
2015-06-16 12:31:00 +03:00
|
|
|
ifeq ($(piegen-y),y)
|
2015-06-05 00:04:03 +03:00
|
|
|
pie/piegen/%: config
|
2015-09-29 22:26:21 +03:00
|
|
|
$(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build)=pie/piegen $@
|
2015-06-05 00:04:03 +03:00
|
|
|
pie/piegen: config
|
2015-09-29 22:26:21 +03:00
|
|
|
$(Q) CC=$(HOSTCC) LD=$(HOSTLD) CFLAGS="$(HOSTCFLAGS)" $(MAKE) $(build)=pie/piegen all
|
2015-06-16 12:31:00 +03:00
|
|
|
$(piegen): pie/piegen/built-in.o
|
2015-06-05 00:04:02 +03:00
|
|
|
$(E) " LINK " $@
|
2015-09-29 22:26:21 +03:00
|
|
|
$(Q) $(HOSTCC) $(HOSTCFLAGS) $^ $(LDFLAGS) -o $@
|
2015-06-05 00:04:02 +03:00
|
|
|
.PHONY: pie/piegen
|
|
|
|
endif
|
|
|
|
|
2015-06-16 12:31:00 +03:00
|
|
|
pie: $(ARCH_DIR) $(piegen)
|
2013-02-15 23:40:30 +04:00
|
|
|
$(Q) $(MAKE) $(build)=pie all
|
2012-01-17 16:08:08 +03:00
|
|
|
|
2013-02-15 23:40:33 +04:00
|
|
|
%.o %.i %.s %.d: $(VERSION_HEADER) pie
|
|
|
|
$(Q) $(MAKE) $(build-crtools)=. $@
|
|
|
|
built-in.o: $(VERSION_HEADER) pie
|
|
|
|
$(Q) $(MAKE) $(build-crtools)=. $@
|
2012-01-26 14:00:40 +04:00
|
|
|
|
2013-08-28 23:57:47 +04:00
|
|
|
lib/%:: $(VERSION_HEADER) config built-in.o
|
|
|
|
$(Q) $(MAKE) $(build)=lib $@
|
|
|
|
lib: $(VERSION_HEADER) config built-in.o
|
|
|
|
$(Q) $(MAKE) $(build)=lib all
|
|
|
|
|
2013-05-24 01:42:11 +04:00
|
|
|
PROGRAM-BUILTINS += protobuf/built-in.o
|
|
|
|
PROGRAM-BUILTINS += built-in.o
|
|
|
|
|
2014-05-22 11:18:01 -07:00
|
|
|
$(SYSCALL-LIB) $(ARCH-LIB) $(PROGRAM-BUILTINS): config
|
2013-05-24 01:42:12 +04:00
|
|
|
|
2013-05-24 01:42:11 +04:00
|
|
|
$(PROGRAM): $(SYSCALL-LIB) $(ARCH-LIB) $(PROGRAM-BUILTINS)
|
2011-09-23 12:00:45 +04:00
|
|
|
$(E) " LINK " $@
|
2014-02-07 20:46:00 +04:00
|
|
|
$(Q) $(CC) $(CFLAGS) $^ $(LIBS) $(LDFLAGS) $(GMONLDOPT) -rdynamic -o $@
|
2011-09-23 12:00:45 +04:00
|
|
|
|
2014-12-31 14:06:50 +02:00
|
|
|
crit:
|
|
|
|
$(Q) $(MAKE) -C pycriu all
|
|
|
|
|
2012-05-29 18:33:00 +04:00
|
|
|
zdtm: all
|
2012-01-24 19:37:44 +04:00
|
|
|
$(Q) $(MAKE) -C test/zdtm all
|
|
|
|
|
|
|
|
test: zdtm
|
2014-05-14 17:35:20 +04:00
|
|
|
$(Q) $(MAKE) -C test
|
2011-09-29 16:03:36 +04:00
|
|
|
|
2013-02-18 17:54:48 +04:00
|
|
|
clean-built:
|
2013-02-11 19:24:06 +04:00
|
|
|
$(Q) $(RM) $(VERSION_HEADER)
|
2014-02-07 12:04:37 -05:00
|
|
|
$(Q) $(MAKE) $(build)=$(ARCH_DIR) clean
|
2013-02-15 23:40:29 +04:00
|
|
|
$(Q) $(MAKE) $(build)=protobuf clean
|
2015-06-05 00:04:02 +03:00
|
|
|
$(Q) $(MAKE) $(build)=pie/piegen clean
|
2013-02-15 23:40:30 +04:00
|
|
|
$(Q) $(MAKE) $(build)=pie clean
|
2013-08-28 23:57:47 +04:00
|
|
|
$(Q) $(MAKE) $(build)=lib clean
|
2013-02-15 23:40:33 +04:00
|
|
|
$(Q) $(MAKE) $(build-crtools)=. clean
|
2013-02-18 17:54:48 +04:00
|
|
|
$(Q) $(MAKE) -C Documentation clean
|
2013-05-20 16:02:14 +04:00
|
|
|
$(Q) $(RM) ./include/config.h
|
2013-02-18 17:54:48 +04:00
|
|
|
$(Q) $(RM) ./$(PROGRAM)
|
|
|
|
|
|
|
|
rebuild: clean-built
|
|
|
|
$(E) " FORCE-REBUILD"
|
|
|
|
$(Q) $(MAKE)
|
|
|
|
|
|
|
|
clean: clean-built
|
|
|
|
$(E) " CLEAN"
|
2013-02-15 17:37:20 +04:00
|
|
|
$(Q) $(RM) ./*.img
|
|
|
|
$(Q) $(RM) ./*.out
|
|
|
|
$(Q) $(RM) ./*.bin
|
|
|
|
$(Q) $(RM) ./*.gcov ./*.gcda ./*.gcno
|
|
|
|
$(Q) $(RM) -r ./gcov
|
2013-08-23 21:47:31 +04:00
|
|
|
$(Q) $(RM) protobuf-desc-gen.h
|
2014-08-26 15:12:58 +04:00
|
|
|
$(Q) $(MAKE) -C test $@
|
2014-12-31 14:06:50 +02:00
|
|
|
$(Q) $(MAKE) -C pycriu $@
|
|
|
|
$(Q) $(RM) ./*.pyc
|
2014-12-31 14:06:52 +02:00
|
|
|
$(Q) $(RM) -r build
|
2015-11-02 21:50:00 +03:00
|
|
|
$(Q) $(RM) -r usr
|
2011-09-23 12:00:45 +04:00
|
|
|
|
2012-02-14 03:10:29 +04:00
|
|
|
distclean: clean
|
|
|
|
$(E) " DISTCLEAN"
|
2013-02-15 17:37:20 +04:00
|
|
|
$(Q) $(RM) ./tags
|
|
|
|
$(Q) $(RM) ./cscope*
|
2012-02-14 03:10:29 +04:00
|
|
|
|
2011-09-23 12:00:45 +04:00
|
|
|
tags:
|
2013-05-01 20:17:08 -07:00
|
|
|
$(E) " GEN " $@
|
2013-02-15 17:37:20 +04:00
|
|
|
$(Q) $(RM) tags
|
2015-05-05 12:44:00 +03:00
|
|
|
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' -print | xargs ctags -a
|
2011-09-23 12:00:45 +04:00
|
|
|
|
|
|
|
cscope:
|
2013-05-01 20:17:08 -07:00
|
|
|
$(E) " GEN " $@
|
2015-05-05 12:44:00 +03:00
|
|
|
$(Q) $(FIND) . -name '*.[hcS]' ! -path './.*' ! -path './test/*' ! -type l -print > cscope.files
|
2011-09-23 12:00:45 +04:00
|
|
|
$(Q) $(CSCOPE) -bkqu
|
2012-01-17 16:08:22 +03:00
|
|
|
|
2012-01-28 18:45:28 +04:00
|
|
|
docs:
|
|
|
|
$(Q) $(MAKE) -s -C Documentation all
|
|
|
|
|
2013-04-30 13:25:06 -07:00
|
|
|
dist: tar
|
|
|
|
tar: criu-$(CRTOOLSVERSION).tar.bz2
|
|
|
|
criu-$(CRTOOLSVERSION).tar.bz2:
|
|
|
|
git archive --format tar --prefix 'criu-$(CRTOOLSVERSION)/' \
|
|
|
|
v$(CRTOOLSVERSION) | bzip2 > $@
|
|
|
|
.PHONY: dist tar
|
|
|
|
|
2015-06-05 18:20:00 +03:00
|
|
|
install: install-criu install-man
|
|
|
|
|
2015-12-14 19:06:00 +03:00
|
|
|
install-criu: all $(CRIU-LIB) install-crit
|
2013-05-03 01:56:30 +04:00
|
|
|
$(E) " INSTALL " $(PROGRAM)
|
|
|
|
$(Q) mkdir -p $(DESTDIR)$(SBINDIR)
|
|
|
|
$(Q) install -m 755 $(PROGRAM) $(DESTDIR)$(SBINDIR)
|
2014-02-05 01:05:00 +04:00
|
|
|
$(Q) mkdir -p $(DESTDIR)$(LIBDIR)
|
2014-02-05 18:28:00 +04:00
|
|
|
$(Q) install -m 755 $(CRIU-LIB) \
|
|
|
|
$(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR)
|
2014-02-15 03:13:00 +04:00
|
|
|
$(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
|
2014-02-05 18:28:00 +04:00
|
|
|
$(DESTDIR)$(LIBDIR)/$(CRIU-SO).so.$(VERSION_SO_MAJOR)
|
2014-02-15 03:13:00 +04:00
|
|
|
$(Q) ln -fns $(CRIU-SO).so.$(VERSION_SO_MAJOR).$(VERSION_SO_MINOR) \
|
2014-02-05 18:28:00 +04:00
|
|
|
$(DESTDIR)$(LIBDIR)/$(CRIU-SO).so
|
2014-02-05 01:05:00 +04:00
|
|
|
$(Q) mkdir -p $(DESTDIR)$(INCLUDEDIR)
|
|
|
|
$(Q) install -m 644 $(CRIU-INC) $(DESTDIR)$(INCLUDEDIR)
|
2013-12-12 02:54:00 +04:00
|
|
|
$(Q) mkdir -p $(DESTDIR)$(SYSTEMDUNITDIR)
|
2015-07-30 18:44:00 +03:00
|
|
|
$(Q) sed -e 's,@version@,$(CRTOOLSVERSION),' \
|
2014-07-31 21:18:00 +04:00
|
|
|
-e 's,@libdir@,$(LIBDIR),' \
|
|
|
|
-e 's,@includedir@,$(dir $(INCLUDEDIR)),' \
|
|
|
|
lib/criu.pc.in > criu.pc
|
|
|
|
$(Q) mkdir -p $(DESTDIR)$(LIBDIR)/pkgconfig
|
|
|
|
$(Q) install -m 644 criu.pc $(DESTDIR)$(LIBDIR)/pkgconfig
|
2013-05-03 01:56:30 +04:00
|
|
|
|
|
|
|
install-man:
|
|
|
|
$(Q) $(MAKE) -C Documentation install
|
|
|
|
|
2014-12-31 14:06:52 +02:00
|
|
|
install-crit: crit
|
|
|
|
$(E) " INSTALL crit"
|
2015-06-01 17:05:00 +03:00
|
|
|
$(Q) python scripts/crit-setup.py install --root=$(DESTDIR) --prefix=$(PREFIX)
|
2014-12-31 14:06:52 +02:00
|
|
|
|
2015-06-05 18:20:00 +03:00
|
|
|
.PHONY: install install-man install-crit install-criu
|
2013-05-03 01:56:30 +04:00
|
|
|
|
2012-01-27 18:41:09 +04:00
|
|
|
help:
|
2013-05-01 20:17:05 -07:00
|
|
|
@echo ' Targets:'
|
|
|
|
@echo ' all - Build all [*] targets'
|
2013-05-01 20:17:06 -07:00
|
|
|
@echo ' * criu - Build criu'
|
2013-05-01 20:17:05 -07:00
|
|
|
@echo ' zdtm - Build zdtm test-suite'
|
|
|
|
@echo ' docs - Build documentation'
|
2013-05-03 01:56:30 +04:00
|
|
|
@echo ' install - Install binary and man page'
|
2013-05-03 01:56:31 +04:00
|
|
|
@echo ' dist - Create a source tarball'
|
2013-05-01 20:17:05 -07:00
|
|
|
@echo ' clean - Clean everything'
|
|
|
|
@echo ' tags - Generate tags file (ctags)'
|
|
|
|
@echo ' cscope - Generate cscope database'
|
|
|
|
@echo ' rebuild - Force-rebuild of [*] targets'
|
|
|
|
@echo ' test - Run zdtm test-suite'
|
2012-01-27 18:41:09 +04:00
|
|
|
|
2012-12-25 22:43:14 +04:00
|
|
|
gcov:
|
|
|
|
$(E) " GCOV"
|
|
|
|
$(Q) mkdir gcov && \
|
|
|
|
cd gcov && \
|
|
|
|
cp ../*.gcno ../*.c ../test/root/crtools/ && \
|
2012-12-26 13:03:43 +04:00
|
|
|
geninfo --no-checksum --output-filename crtools.l.info --no-recursion .. && \
|
|
|
|
geninfo --no-checksum --output-filename crtools.ns.info --no-recursion ../test/root/crtools && \
|
|
|
|
sed -i 's#/test/root/crtools##' crtools.ns.info && \
|
|
|
|
lcov -a crtools.l.info -a crtools.ns.info -o crtools.info && \
|
|
|
|
genhtml -o html crtools.info
|
2013-05-01 20:17:10 -07:00
|
|
|
.PHONY: gcov
|
2012-12-25 22:43:14 +04:00
|
|
|
|
2015-03-20 11:33:09 +03:00
|
|
|
docker-build:
|
|
|
|
docker build -t criu .
|
|
|
|
|
|
|
|
docker-test:
|
|
|
|
docker run --rm -it --privileged criu ./test/zdtm.sh -C -x tcp6 -x tcpbuf6 -x static/rtc -x cgroup -x mountpoint
|
|
|
|
|
2012-05-29 18:33:00 +04:00
|
|
|
.DEFAULT_GOAL := all
|
2015-05-01 02:25:00 +03:00
|
|
|
|
|
|
|
# include optional local rules
|
|
|
|
-include Makefile.local
|