From patchwork Mon Mar 24 04:55:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 332955 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 1D3B82C00AC for ; Mon, 24 Mar 2014 15:55:53 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AB9224B5D2; Mon, 24 Mar 2014 05:55:47 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UEo3lEMy6Zlo; Mon, 24 Mar 2014 05:55:47 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5F8174B5D6; Mon, 24 Mar 2014 05:55:45 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4BDC14B5D6 for ; Mon, 24 Mar 2014 05:55:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uLaiJEkyJm+W for ; Mon, 24 Mar 2014 05:55:36 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by theia.denx.de (Postfix) with ESMTP id 4B2164B5D2 for ; Mon, 24 Mar 2014 05:55:32 +0100 (CET) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile14) with ESMTP id s2O4tTDW000113 for ; Mon, 24 Mar 2014 13:55:29 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili17) with ESMTP id s2O4tU323479 for ; Mon, 24 Mar 2014 13:55:30 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi17) id s2O4tUOA013382; Mon, 24 Mar 2014 13:55:30 +0900 Received: from poodle by lomi17.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s2O4tT73013369; Mon, 24 Mar 2014 13:55:29 +0900 Received: from beagle.diag.org (beagle.diag.org [10.184.179.16]) by poodle (Postfix) with ESMTP id B8E362740043; Mon, 24 Mar 2014 13:55:29 +0900 (JST) From: Masahiro Yamada To: u-boot@lists.denx.de Date: Mon, 24 Mar 2014 13:55:27 +0900 Message-Id: <1395636927-11294-1-git-send-email-yamada.m@jp.panasonic.com> X-Mailer: git-send-email 1.8.3.2 Subject: [U-Boot] [PATCH] kbuild: create a build directory automatically for out-of-tree build X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Prior to Kbuild, the build system created a build directory, when it did not exist, for out-of-tree build. This feature was dropped when we switched to Kbuild because many of lines in makefiles were copied from Linux Kernel. (In Linux Kernel, we have to create a build directory by ourselves before starting build.) That feature seems worth reviving for less typing even if our code and Linux Kernel diverge. Signed-off-by: Masahiro Yamada Suggested-by: Simon Glass Acked-by: Simon Glass Tested-by: Simon Glass --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 538c3bf..0522ba8 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,8 @@ 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))