From: Masahiro Yamada Date: Thu, 14 Jul 2022 05:02:42 +0000 (+0900) Subject: kbuild: error out if $(KBUILD_EXTMOD) contains % or : X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9a68fd7fd8b05050b27ae67a829a2035b2b7a993;p=linux.git 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: Masahiro Yamada Reviewed-by: Nicolas Schier --- diff --git a/Makefile b/Makefile index f8e325709bf37..dee707c98bbe9 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,9 @@ endif $(if $(word 2, $(KBUILD_EXTMOD)), \ $(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 ifneq ($(filter %/, $(KBUILD_EXTMOD)),) KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).)