diff options
author | Masahiro Yamada <yamada.m@jp.panasonic.com> | 2014-03-24 13:55:27 +0900 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-03-28 15:06:31 -0400 |
commit | 5a449d75bca1e8798571cb04093553593e5ed73e (patch) | |
tree | 95b405c0e11a94130da32cac63771ebf0d87efc2 | |
parent | 36c4b1d98059244c34ec3327d9cc9f3c552fd01b (diff) | |
download | u-boot-imx-5a449d75bca1e8798571cb04093553593e5ed73e.zip u-boot-imx-5a449d75bca1e8798571cb04093553593e5ed73e.tar.gz u-boot-imx-5a449d75bca1e8798571cb04093553593e5ed73e.tar.bz2 |
kbuild: create a build directory automatically for out-of-tree build
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 <yamada.m@jp.panasonic.com>
Suggested-by: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | Makefile | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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)) |