Skip to content
Snippets Groups Projects
Commit 5a449d75 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Tom Rini
Browse files

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: default avatarMasahiro Yamada <yamada.m@jp.panasonic.com>
Suggested-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
Tested-by: default avatarSimon Glass <sjg@chromium.org>
parent 36c4b1d9
No related branches found
No related tags found
No related merge requests found
...@@ -124,7 +124,8 @@ ifneq ($(KBUILD_OUTPUT),) ...@@ -124,7 +124,8 @@ ifneq ($(KBUILD_OUTPUT),)
# Invoke a second make in the output directory, passing relevant variables # Invoke a second make in the output directory, passing relevant variables
# check that the output directory actually exists # check that the output directory actually exists
saved-output := $(KBUILD_OUTPUT) 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),, \ $(if $(KBUILD_OUTPUT),, \
$(error output directory "$(saved-output)" does not exist)) $(error output directory "$(saved-output)" does not exist))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment