build: Rework @dist and @tar generation

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@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov 2016-02-18 12:43:29 +03:00 committed by Pavel Emelyanov
parent c1f31142f8
commit d51539ccd2

View file

@ -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: