summaryrefslogtreecommitdiff
path: root/scripts/Kbuild.include
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-06-16 14:58:42 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-06-18 19:46:05 -0400
commit7b348eb6fc9616829f5aea5833fe9b48f05c87c1 (patch)
tree1cfb89dbe678470b1bbc7d8335e930a1b36fd0c5 /scripts/Kbuild.include
parentc3b880acadc95d6e019eae5d669e072afda24f1b (diff)
kbuild: Allow gcov to be enabled on the command linexfs-next
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'scripts/Kbuild.include')
-rw-r--r--scripts/Kbuild.include10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include
index 7778cc97a4e0..5341736f2e30 100644
--- a/scripts/Kbuild.include
+++ b/scripts/Kbuild.include
@@ -277,3 +277,13 @@ ifneq ($(and $(filter notintermediate, $(.FEATURES)),$(filter-out 4.4,$(MAKE_VER
else
.SECONDARY:
endif
+
+ # expand_parents(a/b/c) = a/b/c a/b a
+expand_parents2 = $(if $(subst .,,$(1)),$(call expand_parents,$(1)),)
+expand_parents = $(1) $(call expand_parents2,$(patsubst %/,%,$(dir $(1))))
+
+# flatten_dirs(a/b/c) = a_b_c a_b a
+flatten_dirs = $(subst /,_,$(call expand_parents,$(1)))
+
+# eval_vars(X_,a/b/c) = $(X_a_b_c) $(X_a_b) $(X_a)
+eval_vars = $(foreach var,$(call flatten_dirs,$(2)),$($(1)$(var)))