linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] try to create KBUILD_OUTPUT automatically
@ 2011-10-22 15:12 Peter Foley
  2011-10-24 16:55 ` Valdis.Kletnieks
  2011-12-11 20:34 ` Michal Marek
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Foley @ 2011-10-22 15:12 UTC (permalink / raw)
  To: Linux Kbuild Mailing List, Linux Kernel Mailing List, mmarek

This patch makes it possible to execute make O=work instead of
mkdir work
make O=work

Signed-off-by: Peter Foley <pefoley2@verizon.net>
---
 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 2652089..a4769ac 100644
--- a/Makefile
+++ b/Makefile
@@ -117,7 +117,7 @@ ifneq ($(KBUILD_OUTPUT),)
 # Invoke a second make in the output directory, passing relevant variables
 # check that the output directory actually exists
 saved-output := $(KBUILD_OUTPUT)
-KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
+KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && /bin/pwd)
 $(if $(KBUILD_OUTPUT),, \
      $(error output directory "$(saved-output)" does not exist))
 
-- 
1.7.7


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] try to create KBUILD_OUTPUT automatically
  2011-10-22 15:12 [PATCH RFC] try to create KBUILD_OUTPUT automatically Peter Foley
@ 2011-10-24 16:55 ` Valdis.Kletnieks
  2011-12-11 20:34 ` Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Valdis.Kletnieks @ 2011-10-24 16:55 UTC (permalink / raw)
  To: Peter Foley; +Cc: Linux Kbuild Mailing List, Linux Kernel Mailing List, mmarek

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Sat, 22 Oct 2011 11:12:29 EDT, Peter Foley said:
> This patch makes it possible to execute make O=work instead of
> mkdir work
> make O=work

The case can be made that this is a Bad Idea, because it means you can't catch
a typo in your O= setting.  This is particularly bad when it silently fails to
update the stuff in out-dir because you did a 'make O=out-diir'.

So NACK on this, if anybody cares what I think... ;)


[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC] try to create KBUILD_OUTPUT automatically
  2011-10-22 15:12 [PATCH RFC] try to create KBUILD_OUTPUT automatically Peter Foley
  2011-10-24 16:55 ` Valdis.Kletnieks
@ 2011-12-11 20:34 ` Michal Marek
  1 sibling, 0 replies; 3+ messages in thread
From: Michal Marek @ 2011-12-11 20:34 UTC (permalink / raw)
  To: Peter Foley; +Cc: Linux Kbuild Mailing List, Linux Kernel Mailing List

On 22.10.2011 17:12, Peter Foley wrote:
> This patch makes it possible to execute make O=work instead of
> mkdir work
> make O=work
> 
> Signed-off-by: Peter Foley <pefoley2@verizon.net>
> ---
>  Makefile |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 2652089..a4769ac 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -117,7 +117,7 @@ ifneq ($(KBUILD_OUTPUT),)
>  # Invoke a second make in the output directory, passing relevant variables
>  # check that the output directory actually exists
>  saved-output := $(KBUILD_OUTPUT)
> -KBUILD_OUTPUT := $(shell cd $(KBUILD_OUTPUT) && /bin/pwd)
> +KBUILD_OUTPUT := $(shell mkdir -p $(KBUILD_OUTPUT) && cd $(KBUILD_OUTPUT) && /bin/pwd)
>  $(if $(KBUILD_OUTPUT),, \
>       $(error output directory "$(saved-output)" does not exist))

I think it's a good idea, but please also change the comment and error
message. The command will now only fail if the directory cannot be
created, not if it does not exist.

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-11 20:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-22 15:12 [PATCH RFC] try to create KBUILD_OUTPUT automatically Peter Foley
2011-10-24 16:55 ` Valdis.Kletnieks
2011-12-11 20:34 ` Michal Marek

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 NNTP newsgroup(s).