summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2012-01-02 21:24:36 +0100
committerAchim Gratz <Stromeko@Stromeko.DE>2012-04-20 21:04:11 +0200
commit6ec5f3016511a3ee1bd86f0eeb0915a300cee0bf (patch)
treeaefd4ca8d36f9ca0c9b46b7978f581c09179876f
parent24fa46a9e507684f0b5cd9413004c9d585e9b9c1 (diff)
downloadorg-mode-6ec5f3016511a3ee1bd86f0eeb0915a300cee0bf.tar.gz
Do not croak when git is not available
targets.mk: if no .git directory is present, assume that Git is not available. Make ORGVERSION, GITVERSION and GITSTATUS customizable from local.mk (override from command line is also possible and probably easier)
-rw-r--r--targets.mk23
1 files changed, 14 insertions, 9 deletions
diff --git a/targets.mk b/targets.mk
index 1979622..49795fc 100644
--- a/targets.mk
+++ b/targets.mk
@@ -3,15 +3,20 @@
DISTFILES_extra= Makefile request-assign-future.txt contrib etc
.EXPORT_ALL_VARIABLES:
-LISPDIRS = lisp
-SUBDIRS = doc etc $(LISPDIRS)
-INSTSUB = $(SUBDIRS:%=install-%)
-
-GITVERSION = $(shell git describe --abbrev=6 HEAD)
-ORGVERSION = $(subst release_,,$(shell git describe --abbrev=0 HEAD))
-GITSTATUS = $(shell git status -uno --porcelain)
-DATE = $(shell date +%Y-%m-%d)
-ifneq ("$(GITSTATUS)", "")
+LISPDIRS = lisp
+SUBDIRS = doc etc $(LISPDIRS)
+INSTSUB = $(SUBDIRS:%=install-%)
+
+ifneq ($(wildcard .git),)
+ GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
+ ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
+ GITSTATUS ?= $(shell git status -uno --porcelain)
+else
+ GITVERSION ?= N/A
+ ORGVERSION ?= N/A
+endif
+DATE = $(shell date +%Y-%m-%d)
+ifneq ($(GITSTATUS),)
GITVERSION := $(GITVERSION).dirty
endif