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