diff --git a/Makefile b/Makefile index 504327207d66e4b2b02bed3de555dc6330992b7a..cbab0dc53065d93f314763d21201eb23aa002d70 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,11 @@ endif $(if $(word 2, $(KBUILD_EXTMOD)), \ $(error building multiple external modules is not supported)) +# Remove trailing slashes +ifneq ($(filter %/, $(KBUILD_EXTMOD)),) +KBUILD_EXTMOD := $(shell dirname $(KBUILD_EXTMOD).) +endif + export KBUILD_EXTMOD # Kbuild will save output files in the current working directory.