]> git.sur5r.net Git - i3/i3/blobdiff - common.mk
libi3: Rework draw_text
[i3/i3] / common.mk
index 21e10257e9a86ddbe89da22b20a936063087e7b9..a6d6c4e3f23fc30eb38e105cbdfbfc68523424e0 100644 (file)
--- a/common.mk
+++ b/common.mk
@@ -15,12 +15,12 @@ ifndef SYSCONFDIR
   endif
 endif
 
-I3_VERSION := '$(shell [ -f $(TOPDIR)/VERSION ] && cat $(TOPDIR)/VERSION)'
+# 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/::)\")'
-else
-VERSION := ${I3_VERSION}
 endif
 
 MAJOR_VERSION := $(shell echo ${VERSION} | cut -d '.' -f 1)
@@ -56,6 +56,7 @@ I3_CPPFLAGS += -DMAJOR_VERSION=${MAJOR_VERSION}
 I3_CPPFLAGS += -DMINOR_VERSION=${MINOR_VERSION}
 I3_CPPFLAGS += -DPATCH_VERSION=${PATCH_VERSION}
 I3_CPPFLAGS += -DSYSCONFDIR=\"${SYSCONFDIR}\"
+I3_CPPFLAGS += -DI3__FILE__=__FILE__
 
 
 ## Libraries flags