summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/kbuild/makefiles.txt10
-rw-r--r--scripts/Makefile.lib11
2 files changed, 21 insertions, 0 deletions
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index 5080fec34609..b817e6cefb77 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -1025,6 +1025,16 @@ When kbuild executes, the following steps are followed (roughly):
1025 i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled, 1025 i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled,
1026 this builds them as part of extra-y. 1026 this builds them as part of extra-y.
1027 1027
1028 header-test-pattern-y
1029
1030 This works as a weaker version of header-test-y, and accepts wildcard
1031 patterns. The typical usage is:
1032
1033 header-test-pattern-y += *.h
1034
1035 This specifies all the files that matches to '*.h' in the current
1036 directory, but the files in 'header-test-' are excluded.
1037
1028--- 6.7 Commands useful for building a boot image 1038--- 6.7 Commands useful for building a boot image
1029 1039
1030 Kbuild provides a few macros that are useful when building a 1040 Kbuild provides a few macros that are useful when building a
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 55ae1ec65342..281864fcf0fe 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -67,6 +67,17 @@ extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-))
67endif 67endif
68 68
69# Test self-contained headers 69# Test self-contained headers
70
71# Wildcard searches in $(srctree)/$(src)/, but not in $(objtree)/$(obj)/.
72# Stale generated headers are often left over, so pattern matching should
73# be avoided. Please notice $(srctree)/$(src)/ and $(objtree)/$(obj) point
74# to the same location for in-tree building. So, header-test-pattern-y should
75# be used with care.
76header-test-y += $(filter-out $(header-test-), \
77 $(patsubst $(srctree)/$(src)/%, %, \
78 $(wildcard $(addprefix $(srctree)/$(src)/, \
79 $(header-test-pattern-y)))))
80
70extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y)) 81extra-$(CONFIG_HEADER_TEST) += $(addsuffix .s, $(header-test-y))
71 82
72# Add subdir path 83# Add subdir path