From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id EC1546DE024A for ; Wed, 11 Jan 2017 14:07:22 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.18 X-Spam-Level: X-Spam-Status: No, score=0.18 tagged_above=-999 required=5 tests=[AWL=0.189, HEADER_FROM_DIFFERENT_DOMAINS=0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ookZw_Vt6tAz for ; Wed, 11 Jan 2017 14:07:21 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 5B8426DE01CE for ; Wed, 11 Jan 2017 14:07:21 -0800 (PST) Received: by guru.guru-group.fi (Postfix, from userid 501) id 955E41001CD; Thu, 12 Jan 2017 00:07:06 +0200 (EET) From: Tomi Ollila To: notmuch@notmuchmail.org Cc: tomi.ollila@iki.fi Subject: [RFC PATCH 3] support goals after make *clean, *clean with current Makefile.config Date: Thu, 12 Jan 2017 00:07:05 +0200 Message-Id: <20170111220705.9756-1-tomi.ollila@iki.fi> X-Mailer: git-send-email 2.11.0 In-Reply-To: References: X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2017 22:07:23 -0000 Makes make clean, make distclean and make dataclean faster if Makefile.config exists but configure is newer. After 1st target being *clean, any non-*clean targets may follow it -- these are built in sub-make -- and when control returns to main make, it just recognizes targers already made. --- smoke-tested. goal vs. target terminology is hard always Makefile | 15 +++++++++++++++ Makefile.local | 27 ++++++++++++++++++++------- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 0ef57fa..7540903 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,22 @@ include Makefile.config global_deps = Makefile Makefile.config Makefile.local \ $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local) +ifneq ($(filter clean distclean dataclean, $(word 1, $(MAKECMDGOALS))),) +ifneq ($(filter clean distclean dataclean, $(wordlist 2, 99, $(MAKECMDGOALS))),) +$(error With "$(word 1, $(MAKECMDGOALS))" no further *clean targets works) +endif +WITH_CLEAN := yes +else +WITH_CLEAN := no +endif + +# Potentially speedup make clean, distclean and dataclean ; avoid +# re-creation of Makefile.config if it exists but configure is newer. +ifeq ($(WITH_CLEAN),yes) +Makefile.config: | $(srcdir)/configure +else Makefile.config: $(srcdir)/configure +endif ifeq ($(configure_options),) @echo "" @echo "Note: Calling ./configure with no command-line arguments. This is often fine," diff --git a/Makefile.local b/Makefile.local index 3548ed9..e33af45 100644 --- a/Makefile.local +++ b/Makefile.local @@ -198,18 +198,31 @@ quiet ?= $($(shell echo $1 | sed -e s'/ .*//')) @mkdir -p $(patsubst %/.,%,.deps/$(@D)) $(call quiet,CC $(CPPFLAGS) $(CFLAGS)) -c $(FINAL_CFLAGS) $< -o $@ -MD -MP -MF .deps/$*.d -.PHONY : clean -clean: - rm -rf $(CLEAN); rm -rf .deps +.PHONY: _clean +_clean: + rm -rf $(CLEAN) + rm -rf .deps -.PHONY: distclean -distclean: clean +.PHONY: _distclean +_distclean: _clean rm -rf $(DISTCLEAN) -.PHONY: dataclean -dataclean: distclean +.PHONY: _dataclean +_dataclean: _distclean rm -rf $(DATACLEAN) +clean: _clean +distclean: _distclean +dataclean: _dataclean + +ifeq ($(WITH_CLEAN),yes) +ifneq ($(word 2, $(MAKECMDGOALS)),) +clean distclean dataclean: goals_after_clean +goals_after_clean: + $(MAKE) $(wordlist 2, 99, $(MAKECMDGOALS)) configure_options=$(configure_options) +endif +endif + notmuch_client_srcs = \ command-line-arguments.c\ debugger.c \ -- 2.9.3