Commit 607b30fcf20c6e5339591692db6ffa0b15e041a0

Authored by Michal Marek
1 parent 2da30e703c

kbuild: Create output directory in Makefile.modbuiltin

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

scripts/Makefile.modbuiltin
... ... @@ -14,6 +14,11 @@
14 14  
15 15 include scripts/Kbuild.include
16 16  
  17 +ifneq ($(KBUILD_SRC),)
  18 +# Create output directory if not already present
  19 +_dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj))
  20 +endif
  21 +
17 22 # The filename Kbuild has precedence over Makefile
18 23 kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
19 24 kbuild-file := $(if $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Kbuild,$(kbuild-dir)/Makefile)