diff options
author | Carl Worth <cworth@cworth.org> | 2010-04-16 11:24:43 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2010-04-16 11:34:48 -0700 |
commit | b8f0646931a391062ae58796dad53b70abe25e64 (patch) | |
tree | f0940c159018fde1728542384be71b5fadd0a4c9 /Makefile.local | |
parent | c41a6bb786c3b57d342b77efcc40ae7b6af3020f (diff) |
Makefile: Fix conditionals to avoid calling git when no .git is present
Otherwise, building from a tar-file snapshot or release caused a bunch
of error messages from unnecessary git invocations.
Diffstat (limited to 'Makefile.local')
-rw-r--r-- | Makefile.local | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile.local b/Makefile.local index cb7b865..b338d8b 100644 --- a/Makefile.local +++ b/Makefile.local @@ -10,10 +10,14 @@ # repository), we let git append identification of the actual commit. PACKAGE=notmuch +IS_GIT=$(shell if [ -d .git ] ; then echo yes ; else echo no; fi) + VERSION:=$(shell cat version) ifneq ($(MAKECMDGOALS),release) ifneq ($(MAKECMDGOALS),release-message) -VERSION:=$(shell if git describe > /dev/null 2>&1; then git describe --match '[0-9.]*'; else cat version; fi) +ifeq ($(IS_GIT),yes) +VERSION:=$(shell git describe --match '[0-9.]*') +endif endif endif @@ -60,10 +64,7 @@ $(TAR_FILE): tar --append -f $(TAR_FILE).tmp --transform s_^_$(PACKAGE)-$(VERSION)/_ --transform 's_.tmp$$__' version.tmp rm version.tmp gzip < $(TAR_FILE).tmp > $(TAR_FILE) - -.PHONY: snapshot -snapshot: $(TAR_FILE) - @echo "Snapshot created as $(TAR_FILE)" + @echo "Source is ready for release in $(TAR_FILE)" $(SHA1_FILE): $(TAR_FILE) sha1sum $^ > $@ @@ -129,6 +130,7 @@ release-message: .PHONY: verify-no-dirty-code verify-no-dirty-code: verify-version +ifeq ($(IS_GIT),yes) @printf "Checking that source tree is clean..." ifneq ($(shell git ls-files -m),) @echo "No" @@ -142,6 +144,7 @@ ifneq ($(shell git ls-files -m),) else @echo "Good" endif +endif .PHONY: verify-version verify-version: |