From 0b0dc6a731b50447ac2045b3897f8eaa9a0d2b10 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Wed, 25 Nov 2009 23:42:10 +0100 Subject: Properly build when out of git (using packaged source). --- crawl-ref/source/makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/makefile') diff --git a/crawl-ref/source/makefile b/crawl-ref/source/makefile index 1a2364bca8..1a5b07bb61 100644 --- a/crawl-ref/source/makefile +++ b/crawl-ref/source/makefile @@ -720,7 +720,7 @@ EXTRA_OBJECTS += version.o LIBS += $(CONTRIB_LIBS) $(EXTRA_LIBS) GAME_DEPENDS := $(DESTTILEFILES) $(OBJECTS) $(EXTRA_OBJECTS) $(CONTRIB_LIBS) SRC_PKG_BASE := stone_soup -SRC_VERSION := $(shell git describe --tags --long) +SRC_VERSION := $(shell git describe --tags --long 2>/dev/null || cat util/release_ver) PKG_SRC_DIR := $(SRC_PKG_BASE)-$(SRC_VERSION) SRC_PKG_TAR := $(PKG_SRC_DIR).tar.bz2 SRC_PKG_ZIP := $(PKG_SRC_DIR).zip @@ -956,6 +956,7 @@ clean-rltiles: # To package, you *must* have lex and yacc to generate the intermediates. BSRC = build/crawl-ref/source/ package-source: prebuildyacc depend removeold + @git branch >/dev/null 2>/dev/null || (echo You can package source only from git. && false) rm -rf build mkdir build (cd ../..;git ls-files| \ @@ -969,6 +970,9 @@ package-source: prebuildyacc depend removeold tar xf - -C $(BSRC)contrib/$$x; \ done find build -name .gitignore -execdir rm -f '{}' + + (git describe --tags --long $(MERGE_BASE) 2> /dev/null || \ + git describe --tags $(MERGE_BASE) 2> /dev/null) \ + > $(BSRC)util/release_ver cd build && mv crawl-ref $(PKG_SRC_DIR) cd build && tar cfj ../../../$(SRC_PKG_TAR) $(PKG_SRC_DIR) cd build && zip -rq ../../../$(SRC_PKG_ZIP) $(PKG_SRC_DIR) -- cgit v1.2.3-54-g00ecf