Commit 9a68fd7f authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: error out if $(KBUILD_EXTMOD) contains % or :

If the directory path given to KBUILD_EXTMOD (or M=) contains % or :,
the module fails to build.

% is used in pattern rules, and : as the separator of dependencies.

Bail out with a clearer error message.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Reviewed-by: default avatarNicolas Schier <n.schier@avm.de>
parent 6105e4f6
...@@ -129,6 +129,9 @@ endif ...@@ -129,6 +129,9 @@ endif
$(if $(word 2, $(KBUILD_EXTMOD)), \ $(if $(word 2, $(KBUILD_EXTMOD)), \
$(error building multiple external modules is not supported)) $(error building multiple external modules is not supported))
$(foreach x, % :, $(if $(findstring $x, $(KBUILD_EXTMOD)), \
$(error module directory path cannot contain '$x')))
# Remove trailing slashes # Remove trailing slashes
ifneq ($(filter %/, $(KBUILD_EXTMOD)),) ifneq ($(filter %/, $(KBUILD_EXTMOD)),)
KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).) KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment