notmuch-search-toggle-order and notmuch-tree
[notmuch-archives.git] / 8a / 25d0fb4ac540083f1ff7c8be0eb95c4fadd36c
1 Return-Path: <chris@chris-wilson.co.uk>\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 3D0DC431FBC\r
6         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 05:50:43 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id H4TXvkZ7lLe7 for <notmuch@notmuchmail.org>;\r
11         Sat, 21 Nov 2009 05:50:42 -0800 (PST)\r
12 Received: from fmsmga102.fm.intel.com (mga10.intel.com [192.55.52.92])\r
13         by olra.theworths.org (Postfix) with ESMTP id EE723431FAE\r
14         for <notmuch@notmuchmail.org>; Sat, 21 Nov 2009 05:50:41 -0800 (PST)\r
15 Received: from fmsmga002.fm.intel.com ([10.253.24.26])\r
16         by fmsmga102.fm.intel.com with ESMTP; 21 Nov 2009 05:46:54 -0800\r
17 X-ExtLoop1: 1\r
18 X-IronPort-AV: E=Sophos;i="4.47,263,1257148800"; d="scan'208";a="516100848"\r
19 Received: from unknown (HELO localhost.localdomain) ([10.255.16.192])\r
20         by fmsmga002.fm.intel.com with ESMTP; 21 Nov 2009 05:44:26 -0800\r
21 From: Chris Wilson <chris@chris-wilson.co.uk>\r
22 To: notmuch@notmuchmail.org\r
23 Date: Sat, 21 Nov 2009 13:48:55 +0000\r
24 Message-Id: <1258811335-7082-1-git-send-email-chris@chris-wilson.co.uk>\r
25 X-Mailer: git-send-email 1.6.5.3\r
26 Subject: [notmuch] [PATCH] Makefile: Magic silent rules.\r
27 X-BeenThere: notmuch@notmuchmail.org\r
28 X-Mailman-Version: 2.1.12\r
29 Precedence: list\r
30 List-Id: "Use and development of the notmuch mail system."\r
31         <notmuch.notmuchmail.org>\r
32 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
33         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
34 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
35 List-Post: <mailto:notmuch@notmuchmail.org>\r
36 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
37 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
39 X-List-Received-Date: Sat, 21 Nov 2009 13:50:43 -0000\r
40 \r
41 Use the facilities of GNU make to create a magic function that will\r
42 on the first invocation print a description of how to enable verbose\r
43 compile lines and then print the quiet rule.\r
44 \r
45 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>\r
46 Signed-off-by: Carl Worth <cworth@cworth.org>\r
47 Cc: Mikhail Gusarov <dottedmag@dottedmag.net>\r
48 ---\r
49  Makefile           |   18 +++++++++++++++---\r
50  Makefile.local     |    2 +-\r
51  lib/Makefile.local |    2 +-\r
52  3 files changed, 17 insertions(+), 5 deletions(-)\r
53 \r
54 diff --git a/Makefile b/Makefile\r
55 index 0411cbb..96fcdd5 100644\r
56 --- a/Makefile\r
57 +++ b/Makefile\r
58 @@ -28,14 +28,26 @@ include lib/Makefile.local\r
59  # And get user settings from the output of configure\r
60  include Makefile.config\r
61  \r
62 +# The user has not set any verbosity, default to quiet mode and inform the\r
63 +# user how to enable verbose compiles.\r
64 +ifeq ($(V),)\r
65 +quiet_DOC := "Use \"$(MAKE) V=1\" to see the verbose compile lines.\n"\r
66 +quiet = @echo $(quiet_DOC)$(eval quiet_DOC:=)"  $1     $@";\r
67 +endif\r
68 +# The user has explicitly enabled quiet compilation.\r
69 +ifeq ($(V),0)\r
70 +quiet = @echo "  $1    $@";\r
71 +endif\r
72 +# Otherwise, print the full command line.\r
73 +\r
74  %.o: %.cc\r
75 -       $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@\r
76 +       $(call quiet,CXX) $(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@\r
77  \r
78  %.o: %.c\r
79 -       $(CC) -c $(CFLAGS) $< -o $@\r
80 +       $(call quiet,CC) $(CC) -c $(CFLAGS) $< -o $@\r
81  \r
82  %.elc: %.el\r
83 -       emacs -batch -f batch-byte-compile $<\r
84 +       $(call quiet,EMACS) emacs -batch -f batch-byte-compile $<\r
85  \r
86  .deps/%.d: %.c\r
87         @set -e; rm -f $@; mkdir -p $$(dirname $@) ; \\r
88 diff --git a/Makefile.local b/Makefile.local\r
89 index ecd4ceb..115de0e 100644\r
90 --- a/Makefile.local\r
91 +++ b/Makefile.local\r
92 @@ -20,7 +20,7 @@ notmuch_client_srcs =         \\r
93  \r
94  notmuch_client_modules = $(notmuch_client_srcs:.c=.o)\r
95  notmuch: $(notmuch_client_modules) lib/notmuch.a\r
96 -       $(CXX) $^ $(LDFLAGS) -o $@\r
97 +       $(call quiet,CXX) $(CXX) $^ $(LDFLAGS) -o $@\r
98  \r
99  notmuch.1.gz: notmuch.1\r
100         gzip --stdout notmuch.1 > notmuch.1.gz\r
101 diff --git a/lib/Makefile.local b/lib/Makefile.local\r
102 index 79f7b0b..f635da7 100644\r
103 --- a/lib/Makefile.local\r
104 +++ b/lib/Makefile.local\r
105 @@ -18,7 +18,7 @@ libnotmuch_cxx_srcs =         \\r
106  \r
107  libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)\r
108  $(dir)/notmuch.a: $(libnotmuch_modules)\r
109 -       $(AR) rcs $@ $^\r
110 +       $(call quiet,AR) $(AR) rcs $@ $^\r
111  \r
112  SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)\r
113  CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a\r
114 -- \r
115 1.6.5.3\r
116 \r