[CRIU] [PATCH] build: Add export of sublevels and extra

Cyrill Gorcunov gorcunov at openvz.org
Thu Apr 7 06:05:00 PDT 2016


We use in our PCS7 packaging and I think it's
suitable for everything else as well.

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---

This is for 2.1.

 Makefile.versions     |  2 +-
 criu/Makefile.version | 22 ++++++++++++++--------
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/Makefile.versions b/Makefile.versions
index 6980320751c5..91bef2fb29fd 100644
--- a/Makefile.versions
+++ b/Makefile.versions
@@ -5,7 +5,7 @@ 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))
+CRIU_VERSION		:= $(CRIU_VERSION_MAJOR)$(if $(CRIU_VERSION_MINOR),.$(CRIU_VERSION_MINOR))$(if $(CRIU_VERSION_SUBLEVEL),.$(CRIU_VERSION_SUBLEVEL))$(if $(CRIU_VERSION_EXTRA),.$(CRIU_VERSION_EXTRA))
 
 export CRIU_VERSION_MAJOR CRIU_VERSION_MINOR CRIU_VERSION_SUBLEVEL
 export CRIU_VERSION_EXTRA CRIU_VERSION_NAME CRIU_VERSION
diff --git a/criu/Makefile.version b/criu/Makefile.version
index 9b5a614b5831..123487b5c4f1 100644
--- a/criu/Makefile.version
+++ b/criu/Makefile.version
@@ -19,14 +19,20 @@ $(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 \"$(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)
+	$(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 \"$(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)
+ifneq ($(CRIU_VERSION_SUBLEVEL),)
+	$(Q) echo "#define CRIU_VERSION_SUBLEVEL " $(CRIU_VERSION_SUBLEVEL)	>> $(VERSION_HEADER)
+endif
+ifneq ($(CRIU_VERSION_EXTRA),)
+	$(Q) echo "#define CRIU_VERSION_EXTRA " $(CRIU_VERSION_EXTRA)		>> $(VERSION_HEADER)
+endif
+	$(Q) echo "#define CRIU_GITID \"$(GITID)\""				>> $(VERSION_HEADER)
+	$(Q) echo "#endif /* __CR_VERSION_H__ */"				>> $(VERSION_HEADER)
 
 Makefile.version:
 	@true
-- 
2.5.5



More information about the CRIU mailing list