Skip to content

Commit d171136

Browse files
committed
kbuild: use 'output' variable to create the output directory
$(KBUILD_OUTPUT) specifies the output directory of kernel builds. Use a more generic name, 'output', to better reflect this code hunk in the context of external module builds. Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Nicolas Schier <[email protected]>
1 parent 5ea1721 commit d171136

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,20 @@ export KBUILD_EXTRA_WARN
176176
# The O= assignment takes precedence over the KBUILD_OUTPUT environment
177177
# variable.
178178

179-
# Do we want to change the working directory?
180179
ifeq ("$(origin O)", "command line")
181180
KBUILD_OUTPUT := $(O)
182181
endif
183182

184-
ifneq ($(KBUILD_OUTPUT),)
183+
output := $(KBUILD_OUTPUT)
184+
185+
# Do we want to change the working directory?
186+
ifneq ($(output),)
185187
# $(realpath ...) gets empty if the path does not exist. Run 'mkdir -p' first.
186-
$(shell mkdir -p "$(KBUILD_OUTPUT)")
188+
$(shell mkdir -p "$(output)")
187189
# $(realpath ...) resolves symlinks
188-
abs_output := $(realpath $(KBUILD_OUTPUT))
189-
$(if $(abs_output),,$(error failed to create output directory "$(KBUILD_OUTPUT)"))
190-
endif # ifneq ($(KBUILD_OUTPUT),)
190+
abs_output := $(realpath $(output))
191+
$(if $(abs_output),,$(error failed to create output directory "$(output)"))
192+
endif
191193

192194
ifneq ($(words $(subst :, ,$(abs_srctree))), 1)
193195
$(error source directory cannot contain spaces or colons)

0 commit comments

Comments
 (0)