From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2] Makefile: add --no-builtin-rules flag
Date: Sat, 12 Mar 2016 23:13:45 +0100 [thread overview]
Message-ID: <20160312221345.GC3745@free.fr> (raw)
In-Reply-To: <1457740059-9618-1-git-send-email-arnout@mind.be>
Arnout, All,
On 2016-03-12 00:47 +0100, Arnout Vandecappelle (Essensium/Mind) spake thusly:
> When calling 'make', it takes several seconds before anything happens.
> This is because all the makefiles that have to be parsed and variables
> and rules that have to be evaluated.
>
> One of the rules to be evaluated are the implicit rules that make adds
> to check out the *.mk files from RCS etc. This obviously makes no
> sense. Therefore, disable the built-in rules.
>
> To avoid breaking package that depend on them, make sure we filter this
> out when calling sub-makes. MFLAGS has to be overridden too, otherwise
> the sub-make will just use that instead of MAKEFLAGS when MAKEFLAGS is
> empty.
>
> Time for 'make help > /dev/null' on my machine (with hot cache):
> before after
> real 0m4.167s 0m3.375s
> user 0m3.596s 0m2.928s
> sys 0m0.256s 0m0.180s
>
> and for 'make graph-depends' on a large config:
> before after
> real 0m58.417s 0m53.625s
> user 0m48.284s 0m43.680s
> sys 0m4.076s 0m3.536s
>
> A roughly 10% improvement.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> v2: override MFLAGS as well.
> ---
> Makefile | 2 ++
> package/Makefile.in | 2 ++
> 2 files changed, 4 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index f2822a2..bbb2017 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -29,6 +29,8 @@ UMASK = 0022
> ifneq ($(shell umask),$(UMASK))
> .PHONY: _all $(MAKECMDGOALS)
>
> +%.mk:
> +
> $(MAKECMDGOALS): _all
> @:
>
> diff --git a/package/Makefile.in b/package/Makefile.in
> index fbf5485..730810e 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -1,3 +1,4 @@
> +MAKEFLAGS += --no-builtin-rules
> ifndef MAKE
> MAKE := make
> endif
> @@ -5,6 +6,7 @@ ifndef HOSTMAKE
> HOSTMAKE = $(MAKE)
> endif
> HOSTMAKE := $(shell which $(HOSTMAKE) || type -p $(HOSTMAKE) || echo make)
> +HOSTMAKE += MAKEFLAGS="$(filter-out --no-builtin-rules,$(MAKEFLAGS))" MFLAGS=
Is the extra added complexity worth the improvement?
Regards,
Yann E. MORIN.
> # If BR2_JLEVEL is 0, scale the maximum concurrency with the number of
> # CPUs. An additional job is used in order to keep processors busy
> --
> 2.7.0
>
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2016-03-12 22:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 23:47 [Buildroot] [PATCH v2] Makefile: add --no-builtin-rules flag Arnout Vandecappelle
2016-03-12 22:13 ` Yann E. MORIN [this message]
2016-03-12 22:26 ` Yann E. MORIN
2016-03-13 21:11 ` Arnout Vandecappelle
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160312221345.GC3745@free.fr \
--to=yann.morin.1998@free.fr \
--cc=buildroot@busybox.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox