Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
use git version information if possible, otherwise use information
Browse files Browse the repository at this point in the history
from (I3_)VERSION files (for tarballs)
  • Loading branch information
jolange committed Apr 7, 2016
1 parent 9f27716 commit f74327e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions common.mk
Expand Up @@ -18,12 +18,14 @@ ifndef SYSCONFDIR
endif
endif

# In dist tarballs, the version is stored in the I3_VERSION and VERSION files.
I3_VERSION := '$(shell [ -f $(TOPDIR)/I3_VERSION ] && cat $(TOPDIR)/I3_VERSION)'
VERSION := '$(shell [ -f $(TOPDIR)/VERSION ] && cat $(TOPDIR)/VERSION)'
ifeq ('',$(I3_VERSION))
VERSION := $(shell git describe --tags --abbrev=0)
I3_VERSION := '$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch \"$(shell git describe --tags --always --all | sed s:heads/::)\")'
# In dist and snapshot tarballs, use the I3_VERSION and VERSION files. Otherwise use git information.
ifeq ($(wildcard .git),)
# not in git repository
VERSION := '$(shell [ -f $(TOPDIR)/VERSION ] && cat $(TOPDIR)/VERSION)'
I3_VERSION := '$(shell [ -f $(TOPDIR)/I3_VERSION ] && cat $(TOPDIR)/I3_VERSION)'
else
VERSION := $(shell git describe --tags --abbrev=0)
I3_VERSION := '$(shell git describe --tags --always) ($(shell git log --pretty=format:%cd --date=short -n1), branch \"$(shell git describe --tags --always --all | sed s:heads/::)\")'
endif

MAJOR_VERSION := $(shell echo ${VERSION} | cut -d '.' -f 1)
Expand Down

0 comments on commit f74327e

Please sign in to comment.