Re: [DRAFT PATCH] modified notmuch-emacs-mua
[notmuch-archives.git] / 32 / 0436ab6f00b93eac9f02e000c7f2f2c4717a46
1 Return-Path: <too@guru-group.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 5685C429E28\r
6         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 13:02:05 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 9xlbFmMjwZmt for <notmuch@notmuchmail.org>;\r
16         Sun, 23 Feb 2014 13:02:00 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 76F24431FD6\r
19         for <notmuch@notmuchmail.org>; Sun, 23 Feb 2014 13:02:00 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 4A3701001C6; Sun, 23 Feb 2014 23:01:54 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH v3 1/3] build: write version.stamp file containing $(VERSION)\r
25         string\r
26 Date: Sun, 23 Feb 2014 23:01:46 +0200\r
27 Message-Id: <1393189308-20241-2-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 In-Reply-To: <1393189308-20241-1-git-send-email-tomi.ollila@iki.fi>\r
30 References: <1393189308-20241-1-git-send-email-tomi.ollila@iki.fi>\r
31 Cc: tomi.ollila@iki.fi\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Sun, 23 Feb 2014 21:02:05 -0000\r
45 \r
46 This version file will be as prerequisite to the target files\r
47 that use the version info for some purpose, like printing\r
48 it for the user to examine. The contents of the version.stamp\r
49 file is seldom read by the build system itself as the $(VERSION)\r
50 variable has the same information.\r
51 \r
52 Thanks to Trevor, David and Mark for their contributions.\r
53 ---\r
54  .gitignore     |  1 +\r
55  Makefile.local | 14 +++++++++++++-\r
56  2 files changed, 14 insertions(+), 1 deletion(-)\r
57 \r
58 diff --git a/.gitignore b/.gitignore\r
59 index ef4f074..1fb3a71 100644\r
60 --- a/.gitignore\r
61 +++ b/.gitignore\r
62 @@ -1,5 +1,6 @@\r
63  .first-build-message\r
64  Makefile.config\r
65 +version.stamp\r
66  TAGS\r
67  tags\r
68  *cscope*\r
69 diff --git a/Makefile.local b/Makefile.local\r
70 index 174506c..3a56c06 100644\r
71 --- a/Makefile.local\r
72 +++ b/Makefile.local\r
73 @@ -22,6 +22,11 @@ VERSION:=$(shell cat ${srcdir}/version)\r
74  ifeq ($(filter release release-message pre-release update-versions,$(MAKECMDGOALS)),)\r
75  ifeq ($(IS_GIT),yes)\r
76  VERSION:=$(shell git describe --match '[0-9.]*'|sed -e s/_/~/ -e s/-/+/ -e s/-/~/)\r
77 +# Write the file 'version.stamp' in case its contents differ from $(VERSION)\r
78 +FILE_VERSION:=$(shell test -f version.stamp && read vs < version.stamp || vs=; echo $$vs)\r
79 +ifneq ($(FILE_VERSION),$(VERSION))\r
80 +       $(shell echo "$(VERSION)" > version.stamp)\r
81 +endif\r
82  endif\r
83  endif\r
84  \r
85 @@ -69,6 +74,11 @@ ifeq ($(shell cat .first-build-message 2>/dev/null),)\r
86  endif\r
87  endif\r
88  \r
89 +# Depend (also) on the file 'version'. In case of ifeq ($(IS_GIT),yes)\r
90 +# this file may already have been updated.\r
91 +version.stamp: version\r
92 +       echo $(VERSION) > $@\r
93 +\r
94  $(TAR_FILE):\r
95         if git tag -v $(VERSION) >/dev/null 2>&1; then \\r
96             ref=$(VERSION); \\r
97 @@ -280,6 +290,8 @@ notmuch_client_srcs =               \\r
98  \r
99  notmuch_client_modules = $(notmuch_client_srcs:.c=.o)\r
100  \r
101 +notmuch.o: version.stamp\r
102 +\r
103  notmuch: $(notmuch_client_modules) lib/libnotmuch.a util/libutil.a parse-time-string/libparse-time-string.a\r
104         $(call quiet,CXX $(CFLAGS)) $^ $(FINAL_LIBNOTMUCH_LDFLAGS) -o $@\r
105  \r
106 @@ -318,7 +330,7 @@ install-desktop:\r
107         desktop-file-install --mode 0644 --dir "$(DESTDIR)$(desktop_dir)" notmuch.desktop\r
108  \r
109  SRCS  := $(SRCS) $(notmuch_client_srcs)\r
110 -CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) notmuch.elc\r
111 +CLEAN := $(CLEAN) notmuch notmuch-shared $(notmuch_client_modules) version.stamp\r
112  \r
113  DISTCLEAN := $(DISTCLEAN) .first-build-message Makefile.config\r
114  \r
115 -- \r
116 1.8.0\r
117 \r