git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: GIT Mailing-list <git@vger.kernel.org>
Subject: Re: [PATCH v2 1/5] Documentation/Makefile: conditionally include doc.dep
Date: Sun, 06 Dec 2020 23:44:58 -0800	[thread overview]
Message-ID: <xmqq360icb5x.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <a8e1bc9d-ce6c-d065-5a20-fee15967364d@ramsayjones.plus.com> (Ramsay Jones's message of "Mon, 7 Dec 2020 00:31:43 +0000")

Ramsay Jones <ramsay@ramsayjones.plus.com> writes:

> Notice that, since the 'doc.dep' file does not exist, make takes the
> time (about 8s) to generate several files in order to create the doc.dep
> include file. (If an 'include' file is missing, but a target for the
> said file is present in the Makefile, make will execute that target
> and, if that file now exists, throw away all its internal data and
> re-read and re-parse the Makefile). Having spent the time to include
> the 'doc.dep' file, the 'clean' target immediately deletes those files.
>
> In order to eliminate such wasted effort, use the value of the internal
> $(MAKECMDGOALS) variable to only '-include doc.dep' when the target is
> not 'clean'. (This drops the time down to 12.364s, on my laptop, giving
> an improvement of 47.02%).

Nicely explained.  It might be worth saying

    ... the clean target immediately deletes those files.  The rules
    and definitions of doc.dep however does not affect what 'clean'
    target removes otherwise, so we can do without all this.

The last paragraph made me wonder what should happen for 'distclean'
etc., but luckily there is only 'clean' in Documentation/Makefile ;-)

> Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
> ---
>  Documentation/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 80d1908a44..652d57a1b6 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -286,7 +286,9 @@ doc.dep : $(docdep_prereqs) $(wildcard *.txt) $(wildcard config/*.txt) build-doc
>  	$(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
>  	mv $@+ $@
>  
> +ifneq ($(MAKECMDGOALS),clean)
>  -include doc.dep
> +endif
>  
>  cmds_txt = cmds-ancillaryinterrogators.txt \
>  	cmds-ancillarymanipulators.txt \

  parent reply	other threads:[~2020-12-07  7:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07  0:31 [PATCH v2 1/5] Documentation/Makefile: conditionally include doc.dep Ramsay Jones
2020-12-07  3:18 ` Felipe Contreras
2020-12-08 22:19   ` Ramsay Jones
2020-12-07  7:44 ` Junio C Hamano [this message]
2020-12-08 22:25   ` Ramsay Jones

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq360icb5x.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ramsay@ramsayjones.plus.com \
    /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://80x24.org/mirrors/git.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).