Update Makefile (#417)

* Update makefile so if using 'release' archive to build, the 'version' file is created with the correct version string as .git/HEAD & index is not available.
This commit is contained in:
abraunegg 2019-03-19 13:14:07 +11:00 committed by GitHub
parent 99c0267c7a
commit 58c2805237
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,7 +1,8 @@
DC ?= dmd
RELEASEVER = v2.2.6
pkgconfig := $(shell if [ $(PKGCONFIG) ] && [ "$(PKGCONFIG)" != 0 ] ; then echo 1 ; else echo "" ; fi)
notifications := $(shell if [ $(NOTIFICATIONS) ] && [ "$(NOTIFICATIONS)" != 0 ] ; then echo 1 ; else echo "" ; fi)
gitversion := $(shell if [ -f .git/HEAD ] ; then echo 1 ; else echo "" ; fi)
ifeq ($(pkgconfig),1)
LIBS = $(shell pkg-config --libs sqlite3 libcurl)
@ -126,5 +127,9 @@ endif
for i in $(DOCFILES) ; do rm -f $(DESTDIR)$(DOCDIR)/$$i ; done
rm -f $(DESTDIR)$(MANDIR)/onedrive.1
version: .git/HEAD .git/index
version:
ifeq ($(gitversion),1)
echo $(shell git describe --tags) > version
else
echo $(RELEASEVER) > version
endif