mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
kbuild: create a build directory automatically for out-of-tree build
Kbuild supports saving output files in a separate directory. But the build directory must be created beforehand. For example, $ mkdir -p dir/to/store/output/files $ make O=dir/to/store/output/files defconfig Creating a build directory automatically would be useful. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Michal Marek <mmarek@suse.cz> Change-Id: Ibfbf1509a2b001261234f421babb621106345e5b
This commit is contained in:
parent
745c7c25ac
commit
413b7c456f
1 changed files with 3 additions and 2 deletions
5
Makefile
5
Makefile
|
@ -117,9 +117,10 @@ 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))
|
||||
$(error failed to create output directory "$(saved-output)"))
|
||||
|
||||
PHONY += $(MAKECMDGOALS) sub-make
|
||||
|
||||
|
|
Loading…
Reference in a new issue