diff options
author | Cyrill Gorcunov <gorcunov@openvz.org> | 2016-02-18 12:43:27 +0300 |
---|---|---|
committer | Pavel Emelyanov <xemul@virtuozzo.com> | 2016-02-18 14:15:09 +0300 |
commit | 4854940d6f89620f98a0414969bfe52cd07bf66c (patch) | |
tree | 115fa1331c867e369d8355c11ac4df799ea9ab48 | |
parent | 1b4bd2026fa85852e833cf24d0b90862d9af501a (diff) |
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>
-rw-r--r-- | Makefile | 5 | ||||
-rw-r--r-- | Makefile.versions | 18 | ||||
-rw-r--r-- | criu/Makefile | 11 | ||||
-rw-r--r-- | criu/Makefile.version | 9 | ||||
-rw-r--r-- | lib/Makefile | 5 |
5 files changed, 28 insertions, 20 deletions
@@ -7,6 +7,11 @@ 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 HOSTLD ?= ld diff --git a/Makefile.versions b/Makefile.versions new file mode 100644 index 000000000..6adb38d14 --- /dev/null +++ b/Makefile.versions @@ -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 diff --git a/criu/Makefile b/criu/Makefile index 099020d86..c639b1115 100644 --- a/criu/Makefile +++ b/criu/Makefile @@ -1,15 +1,4 @@ # -# 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. HOSTCC ?= gcc diff --git a/criu/Makefile.version b/criu/Makefile.version index 6007958ad..9b5a614b5 100644 --- a/criu/Makefile.version +++ b/criu/Makefile.version @@ -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) diff --git a/lib/Makefile b/lib/Makefile index 3c0decbe0..03229be98 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -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, $@) |