From: Peter Korsgaard <jacmet@uclibc.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] make clean: improve when no .config present
Date: Wed, 02 Oct 2013 22:40:30 +0200 [thread overview]
Message-ID: <87fvsjpfsx.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <dc1ad257f9e5b8d5b999.1380744400@argentina> (Thomas De Schampheleire's message of "Wed, 02 Oct 2013 22:06:40 +0200")
>>>>> "Thomas" == Thomas De Schampheleire <patrickdepinguin@gmail.com> writes:
Thomas> The 'make clean' recipe is using variables that are not defined
Thomas> without .config file, causing only a partial cleanup when the
Thomas> .config file is accidentally deleted.
Thomas> This patch moves those variables that do not depend on values
Thomas> from .config outside the BR2_HAVE_DOT_CONFIG check, so that
Thomas> 'make clean' is much more similar with and without .config.
Thomas> Since HOST_DIR is determined from BR2_HOST_DIR in .config, the
Thomas> host directory cannot be cleaned correctly without making
Thomas> assumptions, if no .config is present. However, to cover most
Thomas> people's use cases, we assume the default value of
Thomas> $(BASE_DIR)/host in this specific case.
Nit: please wrap the commit text so it fits within 80 chars when
displayed through git log (which indents by 4 spaces).
Thomas> Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Thomas> ---
Thomas> v2: implement initial HOST_DIR value (and move everything to before .config is
Thomas> included.
Thomas> Makefile | 48 ++++++++++++++++++++++++------------------------
Thomas> 1 files changed, 24 insertions(+), 24 deletions(-)
Thomas> diff --git a/Makefile b/Makefile
Thomas> --- a/Makefile
Thomas> +++ b/Makefile
Thomas> @@ -91,6 +91,30 @@ EXTRAMAKEARGS = O=$(O)
Thomas> NEED_WRAPPER=y
Thomas> endif
Thomas> +# bash prints the name of the directory on 'cd <dir>' if CDPATH is
Thomas> +# set, so unset it here to not cause problems. Notice that the export
Thomas> +# line doesn't affect the environment of $(shell ..) calls, so
Thomas> +# explictly throw away any output from 'cd' here.
Thomas> +export CDPATH:=
Thomas> +BASE_DIR := $(shell mkdir -p $(O) && cd $(O) >/dev/null && pwd)
Thomas> +$(if $(BASE_DIR),, $(error output directory "$(O)" does not exist))
Hmm, this means that we always create ./output, even when you run
E.G. 'make help, make print-version or make <blah>'.
I guess it isn't a big problem, and I don't see a solution for it right
away, but it doesn't seem "nice".
Committed, thanks.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2013-10-02 20:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-02 20:06 [Buildroot] [PATCH] make clean: improve when no .config present Thomas De Schampheleire
2013-10-02 20:40 ` Peter Korsgaard [this message]
2013-10-03 7:42 ` Thomas De Schampheleire
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=87fvsjpfsx.fsf@dell.be.48ers.dk \
--to=jacmet@uclibc.org \
--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