2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 22:05:36 +00:00

build: Move versions definitions on top level

- define all versions in Makefile.versions toplevel file
 - rename CRTOOLSVERSION to CRIU_VERSION (and add CRIU_ prefixes)
 - rename versions for C librabry

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov
2016-02-18 12:43:27 +03:00
committed by Pavel Emelyanov
parent 1b4bd2026f
commit 4854940d6f
5 changed files with 28 additions and 20 deletions

View File

@@ -6,6 +6,11 @@ export __nmk_dir
include $(__nmk_dir)/include.mk
include $(__nmk_dir)/macro.mk
#
# Import tools versions early
# so subsequents may refer them.
include Makefile.versions
#
# To build host helpers.
HOSTCC ?= gcc

18
Makefile.versions Normal file
View File

@@ -0,0 +1,18 @@
#
# CRIU version.
CRIU_VERSION_MAJOR := 2
CRIU_VERSION_MINOR := 0
CRIU_VERSION_SUBLEVEL :=
CRIU_VERSION_EXTRA :=
CRIU_VERSION_NAME :=
CRIU_VERSION := $(CRIU_VERSION_MAJOR)$(if $(CRIU_VERSION_MINOR),.$(CRIU_VERSION_MINOR))$(if $(CRIU_VERSION_SUBLEVEL),.$(CRIU_VERSION_SUBLEVEL))
export CRIU_VERSION_MAJOR CRIU_VERSION_MINOR CRIU_VERSION_SUBLEVEL
export CRIU_VERSION_EXTRA CRIU_VERSION_NAME CRIU_VERSION
#
# C library for CRIU.
CRIU_SO_VERSION_MAJOR := 1
CRIU_SO_VERSION_MINOR := 0
export CRIU_SO_VERSION_MAJOR CRIU_SO_VERSION_MINOR

View File

@@ -1,14 +1,3 @@
#
# CRIU version.
VERSION_MAJOR := 2
VERSION_MINOR := 0
VERSION_SUBLEVEL :=
VERSION_EXTRA :=
VERSION_NAME :=
export VERSION_MAJOR VERSION_MINOR
export VERSION_SUBLEVEL VERSION_EXTRA VERSION_NAME
#
# HOST part is needed to build helper
# tools such as piegen.

View File

@@ -1,6 +1,5 @@
include $(__nmk_dir)msg.mk
CRTOOLSVERSION := $(VERSION_MAJOR)$(if $(VERSION_MINOR),.$(VERSION_MINOR))$(if $(VERSION_SUBLEVEL),.$(VERSION_SUBLEVEL))
VERSION_HEADER := include/version.h
GITID_FILE := ../.gitid
GITID := $(shell if [ -d "../.git" ]; then cd .. && git describe; fi)
@@ -18,14 +17,14 @@ $(GITID_FILE):
$(call msg-gen, $@)
$(Q) echo "$(GITID)" > $(GITID_FILE)
$(VERSION_HEADER): Makefile.version $(GITID_FILE)
$(VERSION_HEADER): ../Makefile.versions $(GITID_FILE)
$(call msg-gen, $@)
$(Q) echo "/* Autogenerated, do not edit */" > $(VERSION_HEADER)
$(Q) echo "#ifndef __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "#define __CR_VERSION_H__" >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION \"$(CRTOOLSVERSION)\"" >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MAJOR " $(VERSION_MAJOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MINOR " $(VERSION_MINOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION \"$(CRIU_VERSION)\"" >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MAJOR " $(CRIU_VERSION_MAJOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_VERSION_MINOR " $(CRIU_VERSION_MINOR) >> $(VERSION_HEADER)
$(Q) echo "#define CRIU_GITID \"$(GITID)\"" >> $(VERSION_HEADER)
$(Q) echo "#endif /* __CR_VERSION_H__ */" >> $(VERSION_HEADER)

View File

@@ -1,9 +1,6 @@
include $(__nmk_dir)/include.mk
include $(__nmk_dir)/macro.mk
VERSION_SO_MAJOR := 1
VERSION_SO_MINOR := 0
CRIU_SO := libcriu.so
#
@@ -15,7 +12,7 @@ c/built-in.o:
$(call msg-gen, $@)
$(Q) $(MAKE) $(build)=c all
cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(VERSION_SO_MAJOR)
cflags-so += $(CFLAGS) -rdynamic -Wl,-soname,$(lib-so).so.$(CRIU_SO_VERSION_MAJOR)
ldflags-so += -lprotobuf-c
c/$(CRIU_SO): c/built-in.o
$(call msg-link, $@)