diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-11-25 23:42:10 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-11-25 23:42:10 +0100 |
commit | 0b0dc6a731b50447ac2045b3897f8eaa9a0d2b10 (patch) | |
tree | 62516bc6ce599fce7c485ba7c802bb1cc7be21e4 /crawl-ref/source | |
parent | a410ea842acb2c40616acc1f8e50b832bebdbf90 (diff) | |
download | crawl-ref-0b0dc6a731b50447ac2045b3897f8eaa9a0d2b10.tar.gz crawl-ref-0b0dc6a731b50447ac2045b3897f8eaa9a0d2b10.zip |
Properly build when out of git (using packaged source).
Diffstat (limited to 'crawl-ref/source')
-rw-r--r-- | crawl-ref/source/makefile | 6 | ||||
-rwxr-xr-x | crawl-ref/source/util/gen_ver.pl | 17 | ||||
-rw-r--r-- | crawl-ref/source/util/release_ver | 1 |
3 files changed, 14 insertions, 10 deletions
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) diff --git a/crawl-ref/source/util/gen_ver.pl b/crawl-ref/source/util/gen_ver.pl index 4902be79a9..46317fe19d 100755 --- a/crawl-ref/source/util/gen_ver.pl +++ b/crawl-ref/source/util/gen_ver.pl @@ -17,12 +17,6 @@ if (!$mergebase) { $mergebase = ""; } -my $releasever; - -open IN, "<", "$scriptpath/release_ver"; -read IN, $releasever, 32; -close IN; - mkdir dirname($outfile); my $verstring = ""; @@ -30,8 +24,15 @@ my $verstring = ""; $verstring = `git describe --tags --long $mergebase 2> /dev/null || git describe --tags $mergebase 2> /dev/null`; if (!$verstring) { - print STDERR "WARNING: Couldn't get revision information from Git. Using $scriptpath/release_ver.\n"; - $verstring = $releasever; + if (open IN, "<", "$scriptpath/release_ver") + { + $verstring = <IN>; + close IN; + } + else + { + die "No Git, and $scriptpath/release_ver doesn't exist.\n"; + } $in_git = 0; } diff --git a/crawl-ref/source/util/release_ver b/crawl-ref/source/util/release_ver deleted file mode 100644 index aa64bcec46..0000000000 --- a/crawl-ref/source/util/release_ver +++ /dev/null @@ -1 +0,0 @@ -0.6.0-a0 |