summaryrefslogtreecommitdiff
path: root/scripts/Kbuild.include
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 2bc08ace38a3..cbe28744637b 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -41,6 +41,11 @@ escsq = $(subst $(squote),'\$(squote)',$1)
stringify = $(squote)$(quote)$1$(quote)$(squote)
###
+# The path to Kbuild or Makefile. Kbuild has precedence over Makefile.
+kbuild-dir = $(if $(filter /%,$(src)),$(src),$(srctree)/$(src))
+kbuild-file = $(or $(wildcard $(kbuild-dir)/Kbuild),$(kbuild-dir)/Makefile)
+
+###
# Easy method for doing a status message
kecho := :
quiet_kecho := echo