# contain a comma
depfile = $(subst $(comma),_,$(@D)/.$(@F).d)
+###
+# filename of target with directory and extension stripped
+basetarget = $(basename $(notdir $@))
+
###
# Escape single quote for use in echo statements
escsq = $(subst $(squote),'\$(squote)',$1)
# $(Q)$(MAKE) $(build)=dir
build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
+# Prefix -I with $(srctree) if it is not an absolute path
+addtree = $(if $(filter-out -I/%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1))) $(1)
+# Find all -I options and call addtree
+flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
+
# If quiet is set, only print short version of command
cmd = @$(echo-cmd) $(cmd_$(1))