public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Foley <pefoley2@verizon.net>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Kbuild Mailing List <linux-kbuild@vger.kernel.org>,
	mmarek@suse.cz
Subject: [PATCH V2] try to create KBUILD_OUTDIR automatically
Date: Thu, 15 Dec 2011 08:40:36 -0500 (EST)	[thread overview]
Message-ID: <alpine.LNX.2.00.1112150832360.61146@linux> (raw)

This patch makes it possible to execute make O=/path/to/work instead of
mkdir -p /path/to/work
make O=/path/to/work

Signed-off-by: Peter Foley <pefoley2@verizon.net>
---

V2:
update error message

 Makefile |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index d1ea73f..5855399 100644
--- a/Makefile
+++ b/Makefile
@@ -115,11 +115,11 @@ $(CURDIR)/Makefile Makefile: ;
 
 ifneq ($(KBUILD_OUTPUT),)
 # Invoke a second make in the output directory, passing relevant variables
-# check that the output directory actually exists
+# check that the output directory exists or can be created
 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))
+     $(error output directory "$(saved-output)" does not exist and cannot be created))
 
 PHONY += $(MAKECMDGOALS) sub-make
 
-- 
1.7.8


                 reply	other threads:[~2011-12-15 14:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LNX.2.00.1112150832360.61146@linux \
    --to=pefoley2@verizon.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    /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