]> git.cworth.org Git - notmuch/blob - Makefile.global
build: Move variable definitions to Makefile.global
[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
27 # Write the file 'version.stamp' in case its contents differ from $(VERSION)
28 FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)
29 ifneq ($(FILE_VERSION),$(VERSION))
30        $(shell echo "$(VERSION)" > version.stamp)
31 endif
32 endif
33 endif
34
35 UPSTREAM_TAG=$(subst ~,_,$(VERSION))
36 DEB_TAG=debian/$(UPSTREAM_TAG)-1
37
38 RELEASE_HOST=notmuchmail.org
39 RELEASE_DIR=/srv/notmuchmail.org/www/releases
40 RELEASE_URL=https://notmuchmail.org/releases
41 TAR_FILE=$(PACKAGE)-$(VERSION).tar.gz
42 ELPA_FILE:=$(PACKAGE)-emacs-$(ELPA_VERSION).tar
43 DEB_TAR_FILE=$(PACKAGE)_$(VERSION).orig.tar.gz
44 SHA1_FILE=$(TAR_FILE).sha1
45 GPG_FILE=$(SHA1_FILE).asc
46
47 PV_FILE=bindings/python/notmuch/version.py
48
49 # Smash together user's values with our extra values
50 STD_CFLAGS := -std=gnu99
51 FINAL_CFLAGS = -DNOTMUCH_VERSION=$(VERSION) $(CPPFLAGS) $(STD_CFLAGS) $(CFLAGS) $(WARN_CFLAGS) $(extra_cflags) $(CONFIGURE_CFLAGS)
52 FINAL_CXXFLAGS = $(CPPFLAGS) $(CXXFLAGS) $(WARN_CXXFLAGS) $(extra_cflags) $(extra_cxxflags) $(CONFIGURE_CXXFLAGS)
53 FINAL_NOTMUCH_LDFLAGS = $(LDFLAGS) -Lutil -lutil -Llib -lnotmuch
54 ifeq ($(LIBDIR_IN_LDCONFIG),0)
55 FINAL_NOTMUCH_LDFLAGS += $(RPATH_LDFLAGS)
56 endif
57 FINAL_NOTMUCH_LDFLAGS += $(AS_NEEDED_LDFLAGS) $(GMIME_LDFLAGS) $(TALLOC_LDFLAGS) $(ZLIB_LDFLAGS)
58 FINAL_NOTMUCH_LINKER = CC
59 ifneq ($(LINKER_RESOLVES_LIBRARY_DEPENDENCIES),1)
60 FINAL_NOTMUCH_LDFLAGS += $(CONFIGURE_LDFLAGS)
61 FINAL_NOTMUCH_LINKER = CXX
62 endif
63 FINAL_LIBNOTMUCH_LDFLAGS = $(LDFLAGS) $(AS_NEEDED_LDFLAGS) $(CONFIGURE_LDFLAGS)