unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Mikhail Gusarov <dottedmag@dottedmag.net>
To: notmuch@notmuchmail.org
Subject: [PATCH] RFC: quiet make
Date: Fri, 20 Nov 2009 19:18:27 +0600	[thread overview]
Message-ID: <1258723107-14704-1-git-send-email-dottedmag@dottedmag.net> (raw)

I don't entirely like duplicating every command line in makefile,
so this patch is RFC. Someone with bigger Make-fu than mine probably
knows a better way.

Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
---
 Makefile           |   36 ++++++++++++++++++++++++++++++++++++
 Makefile.local     |   10 ++++++++++
 lib/Makefile.local |    5 +++++
 3 files changed, 51 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index b6861e9..72a72ae 100644
--- a/Makefile
+++ b/Makefile
@@ -32,29 +32,65 @@ include lib/Makefile.local
 include Makefile.config
 
 %.o: %.cc $(all_deps)
+ifeq ($(V),1)
 	$(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
+else
+	@echo CXX $<
+	@$(CXX) -c $(CFLAGS) $(CXXFLAGS) $< -o $@
+endif
 
 %.o: %.c $(all_deps)
+ifeq ($(V),1)
 	$(CC) -c $(CFLAGS) $< -o $@
+else
+	@echo CC $<
+	@$(CC) -c $(CFLAGS) $< -o $@
+endif
 
 %.elc: %.el
+ifeq ($(V),1)
 	emacs -batch -f batch-byte-compile $<
+else
+	@echo ELCOMPILE $<
+	@emacs -batch -f batch-byte-compile $<
+endif
 
 .deps/%.d: %.c $(all_deps)
+ifeq ($(V),1)
+	set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
+	$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
+	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
+	rm -f $@.$$$$
+else
+	@echo DEPCXX $<
 	@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
 	$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@.$$$$; \
 	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
 	rm -f $@.$$$$
+endif
 
 .deps/%.d: %.cc $(all_deps)
+ifeq ($(V),1)
+	set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
+	$(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
+	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
+	rm -f $@.$$$$
+else
+	@echo DEPCC $<
 	@set -e; rm -f $@; mkdir -p $$(dirname $@) ; \
 	$(CXX) -M $(CPPFLAGS) $(CXXFLAGS) $< > $@.$$$$; \
 	sed 's,'$$(basename $*)'\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
 	rm -f $@.$$$$
+endif
 
 DEPS := $(SRCS:%.c=.deps/%.d)
 DEPS := $(DEPS:%.cc=.deps/%.d)
 -include $(DEPS)
 
 clean:
+ifeq ($(V),1)
 	rm -f $(CLEAN); rm -rf .deps
+else
+	@echo CLEAN
+	@rm -f $(CLEAN); rm -rf .deps
+endif
diff --git a/Makefile.local b/Makefile.local
index bf81c03..0addfed 100644
--- a/Makefile.local
+++ b/Makefile.local
@@ -20,10 +20,20 @@ notmuch_client_srcs =		\
 
 notmuch_client_modules = $(notmuch_client_srcs:.c=.o)
 notmuch: $(notmuch_client_modules) lib/notmuch.a
+ifeq ($(V),1)
 	$(CXX) $^ $(LDFLAGS) -o $@
+else
+	@echo LINK $^
+	@$(CXX) $^ $(LDFLAGS) -o $@
+endif
 
 notmuch.1.gz: notmuch.1
+ifeq ($(V),1)
 	gzip --stdout notmuch.1 > notmuch.1.gz
+else
+	@echo GZIP $<
+	@gzip --stdout notmuch.1 > notmuch.1.gz
+endif
 
 install: all notmuch.1.gz
 	for d in $(DESTDIR)$(prefix)/bin/ $(DESTDIR)$(prefix)/share/man/man1 \
diff --git a/lib/Makefile.local b/lib/Makefile.local
index 79f7b0b..5a66716 100644
--- a/lib/Makefile.local
+++ b/lib/Makefile.local
@@ -18,7 +18,12 @@ libnotmuch_cxx_srcs =		\
 
 libnotmuch_modules = $(libnotmuch_c_srcs:.c=.o) $(libnotmuch_cxx_srcs:.cc=.o)
 $(dir)/notmuch.a: $(libnotmuch_modules)
+ifeq ($(V),1)
 	$(AR) rcs $@ $^
+else
+	@echo AR $^
+	@$(AR) rcs $@ $^
+endif
 
 SRCS  := $(SRCS) $(libnotmuch_c_srcs) $(libnotmuch_cxx_srcs)
 CLEAN := $(CLEAN) $(libnotmuch_modules) $(dir)/notmuch.a
-- 
1.6.3.3

             reply	other threads:[~2009-11-20 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20 13:18 Mikhail Gusarov [this message]
2009-11-21 13:16 ` [PATCH] RFC: quiet make Carl Worth
2009-11-21 13:21   ` Mikhail Gusarov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1258723107-14704-1-git-send-email-dottedmag@dottedmag.net \
    --to=dottedmag@dottedmag.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).