'make dist' creates a tarball for the current checkout. 'make qemu-${version}.tar.bz2' creates a tarball for git tag v${version}.
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- Makefile | 5 ++--- scripts/make-release | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ab82ef3..4a5f399 100644 --- a/Makefile +++ b/Makefile @@ -233,9 +233,8 @@ clean: rm -f $$d/qemu-options.def; \ done -VERSION ?= $(shell cat VERSION) - -dist: qemu-$(VERSION).tar.bz2 +dist: + $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" qemu-%.tar.bz2: $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" diff --git a/scripts/make-release b/scripts/make-release index 196c755..181ca77 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -12,11 +12,17 @@ src="$1" version="$2" +if test "$version" = ""; then + commit=$(git describe --long) + version="${commit#v}" +else + commit="v${version}" +fi destination=qemu-${version} git clone "${src}" ${destination} pushd ${destination} -git checkout "v${version}" +git checkout "${commit}" git submodule update --init rm -rf .git roms/*/.git popd -- 1.7.1