Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e846f0dc authored by Jani Nikula's avatar Jani Nikula Committed by Masahiro Yamada
Browse files

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: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 0315bb7a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
*.elf
*.gcno
*.gz
*.hdrtest.c
*.i
*.ko
*.lex.c
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
*.grep
*.grp
*.gz
*.hdrtest.c
*.html
*.i
*.jpeg
+7 −0
Original line number Diff line number Diff line
@@ -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

+1 −0
Original line number Diff line number Diff line
@@ -1647,6 +1647,7 @@ clean: $(clean-dirs)
		-o -name '*.dwo' -o -name '*.lst' \
		-o -name '*.su'  \
		-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
		-o -name '*.hdrtest.c' \
		-o -name '*.lex.c' -o -name '*.tab.[ch]' \
		-o -name '*.asn1.[ch]' \
		-o -name '*.symtypes' -o -name 'modules.order' \

drivers/gpu/drm/i915/.gitignore

deleted100644 → 0
+0 −1
Original line number Diff line number Diff line
header_test_*.c
Loading