summaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2019-06-04 14:42:48 +0200
committerMasahiro Yamada <yamada.masahiro@socionext.com>2019-06-15 12:57:02 +0200
commite846f0dc57f441e5e93194d39bc9b8ac2ab5e0a4 (patch)
treeb58f3a2e11125b3ed4f35f0c0c14380e3374b9db /Documentation
parentkbuild: deb-pkg: do not run headers_check (diff)
downloadlinux-e846f0dc57f441e5e93194d39bc9b8ac2ab5e0a4.tar.xz
linux-e846f0dc57f441e5e93194d39bc9b8ac2ab5e0a4.zip
kbuild: add support for ensuring headers are self-contained
Sometimes it's useful to be able to explicitly ensure certain headers remain self-contained, i.e. that they are compilable as standalone units, by including and/or forward declaring everything they depend on. Add special target header-test-y where individual Makefiles can add headers to be tested if CONFIG_HEADER_TEST is enabled. This will generate a dummy C file per header that gets built as part of extra-y. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/dontdiff1
-rw-r--r--Documentation/kbuild/makefiles.txt7
2 files changed, 8 insertions, 0 deletions
diff --git a/Documentation/dontdiff b/Documentation/dontdiff
index 5eba889ea84d..554dfe4883d2 100644
--- a/Documentation/dontdiff
+++ b/Documentation/dontdiff
@@ -19,6 +19,7 @@
*.grep
*.grp
*.gz
+*.hdrtest.c
*.html
*.i
*.jpeg
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index bac301a73a86..ca4b24ec0399 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -1018,6 +1018,13 @@ When kbuild executes, the following steps are followed (roughly):
In this example, extra-y is used to list object files that
shall be built, but shall not be linked as part of built-in.a.
+ header-test-y
+
+ header-test-y specifies headers (*.h) in the current directory that
+ should be compile tested to ensure they are self-contained,
+ i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled,
+ this autogenerates dummy sources to include the headers, and builds them
+ as part of extra-y.
--- 6.7 Commands useful for building a boot image