diff --git a/Makefile b/Makefile index e7232186273fae0df000761428a61a4d7c4a0c1e..341f336ce5e3c8ee3420cda78623f469dea1bcdd 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))