1 # -*- makefile-gmake -*-
2 # Here's the (hopefully simple) versioning scheme.
4 # Releases of notmuch have a two-digit version (0.1, 0.2, etc.). We
5 # increment the second digit for each release and increment the first
6 # digit when we reach particularly major milestones of usability.
8 # Between releases, (such as when compiling notmuch from the git
9 # repository), we let git append identification of the actual commit.
12 IS_GIT:=$(if $(wildcard ${srcdir}/.git),yes,no)
15 DATE:=$(shell git --git-dir=${srcdir}/.git log --date=short -1 --pretty=format:%cd)
17 DATE:=$(shell date +%F)
20 VERSION:=$(shell cat ${srcdir}/version)
21 ELPA_VERSION:=$(subst ~,_,$(VERSION))
22 ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)
24 VERSION:=$(shell git --git-dir=${srcdir}/.git describe --abbrev=7 --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
25 # drop the ~g$sha1 part
26 ELPA_VERSION:=$(word 1,$(subst ~, ,$(VERSION)))
27 # convert git version to package.el friendly form
28 ELPA_VERSION:=$(subst +,snapshot,$(ELPA_VERSION))
30 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
31 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
32 ifneq ($(FILE_VERSION),$(VERSION))
33 $(shell echo "$(VERSION)" > version.stamp)
38 UPSTREAM_TAG=$(subst ~,_,$(VERSION))
39 DEB_TAG=debian/$(UPSTREAM_TAG)-1
41 RELEASE_HOST=notmuchmail.org
42 RELEASE_DIR=/srv/notmuchmail.org/www/releases
43 DOC_DIR=/srv/notmuchmail.org/www/doc/latest
44 RELEASE_URL=https://notmuchmail.org/releases
45 TAR_FILE=$(PACKAGE)-$(VERSION).tar.xz
46 ELPA_FILE:=$(PACKAGE)-emacs-$(ELPA_VERSION).tar
47 DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.xz
48 SHA256_FILE=$(TAR_FILE).sha256.asc
49 DETACHED_SIG_FILE=$(TAR_FILE).asc
51 PV_FILE=bindings/python/notmuch/version.py
53 # Smash together user's values with our extra values
54 FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
55 FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS)
56 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lnotmuch_util -Llib -lnotmuch
57 ifeq ($(LIBDIR_IN_LDCONFIG),0)
58 FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS)
60 FINAL_NOTMUCH_LDFLAGS += $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS)
61 FINAL_NOTMUCH_LINKER = CC
62 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
63 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
64 FINAL_NOTMUCH_LINKER = CXX
66 FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS)