[CRIU] [PATCH 3/3] build: Rework @dist and @tar generation

Cyrill Gorcunov gorcunov at openvz.org
Thu Feb 18 01:43:29 PST 2016


Currently our @tar target imples that there
is a tag in form of "vX.X", if such tag is
not present in the repo we're in trouble.

So make it sane

 - if tag present then create tar from this tag
 - if tag is not present simply use git describe helper

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index 1da3a74d7255..f4214176fcd8 100644
--- a/Makefile
+++ b/Makefile
@@ -155,11 +155,14 @@ test: zdtm
 	$(Q) $(MAKE) -C test
 PHONY += test
 
-dist: tar
-tar: criu-$(CRTOOLSVERSION).tar.bz2
-criu-$(CRTOOLSVERSION).tar.bz2:
-	git archive --format tar --prefix 'criu-$(CRTOOLSVERSION)/' \
-		v$(CRTOOLSVERSION) | bzip2 > $@
+tar-name := $(shell git tag -l v$(CRIU_VERSION))
+ifeq ($(tar-name),)
+        tar-name := $(shell git describe)
+endif
+criu-$(tar-name).tar.bz2:
+	git archive --format tar --prefix 'criu-$(tar-name)/' $(tar-name) | bzip2 > $@
+dist tar: criu-$(tar-name).tar.bz2
+	@true
 .PHONY: dist tar
 
 tags:
-- 
2.5.0



More information about the CRIU mailing list