All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kbuild: compile-test global headers to ensure they are self-contained
@ 2019-06-21 16:39 ` Masahiro Yamada
  0 siblings, 0 replies; 16+ messages in thread
From: Masahiro Yamada @ 2019-06-21 16:39 UTC (permalink / raw)
  To: linux-kbuild
  Cc: Masahiro Yamada, linux-kernel, Michal Marek, linux-mediatek,
	Matthias Brugger, linux-arm-kernel

Make as many headers self-contained as possible so that they can be
included without relying on a specific include order.

This commit compiles only a few headers, but it is a good start point.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 Makefile         |  1 +
 include/Makefile | 31 +++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+)
 create mode 100644 include/Makefile

diff --git a/Makefile b/Makefile
index c23f5e8381ad..82c1722dd9e9 100644
--- a/Makefile
+++ b/Makefile
@@ -610,6 +610,7 @@ drivers-y	:= drivers/ sound/
 drivers-$(CONFIG_SAMPLES) += samples/
 net-y		:= net/
 libs-y		:= lib/
+libs-$(CONFIG_HEADER_TEST) += include/
 core-y		:= usr/
 virt-y		:= virt/
 endif # KBUILD_EXTMOD
diff --git a/include/Makefile b/include/Makefile
new file mode 100644
index 000000000000..68a76ac732c3
--- /dev/null
+++ b/include/Makefile
@@ -0,0 +1,31 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+# extend the test coverage when existing errors are fixed
+
+header-test += linux/w*.h
+header-test += linux/x*.h
+header-test += linux/y*.h
+header-test += ras/*.h
+header-test += soc/at91/*.h
+header-test += soc/bcm2835/*.h
+header-test += soc/mediatek/*.h
+header-test += soc/sa1100/*.h
+
+all-headers = $(patsubst $(srctree)/include/%,%,\
+	    $(wildcard $(addprefix $(srctree)/include/, $(header-test))))
+
+# Do not include directly
+no-header-test += linux/compiler-clang.h
+no-header-test += linux/compiler-gcc.h
+no-header-test += linux/patchkey.h
+no-header-test += linux/rwlock_api_smp.h
+no-header-test += linux/spinlock_types_up.h
+no-header-test += linux/spinlock_up.h
+no-header-test += linux/wimax/debug.h
+no-header-test += rdma/uverbs_named_ioctl.h
+
+# Conditionally included
+no-header-test += linux/byteorder/big_endian.h
+no-header-test += linux/byteorder/little_endian.h
+
+header-test-y = $(filter-out $(no-header-test), $(all-headers))
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2019-06-27  6:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-21 16:39 [PATCH] kbuild: compile-test global headers to ensure they are self-contained Masahiro Yamada
2019-06-21 16:39 ` Masahiro Yamada
2019-06-21 16:39 ` Masahiro Yamada
2019-06-21 17:51 ` Sam Ravnborg
2019-06-21 17:51   ` Sam Ravnborg
2019-06-22 12:30   ` Masahiro Yamada
2019-06-22 12:30     ` Masahiro Yamada
2019-06-22 13:06     ` Sam Ravnborg
2019-06-22 13:06       ` Sam Ravnborg
2019-06-24 21:40       ` Sam Ravnborg
2019-06-24 21:40         ` Sam Ravnborg
2019-06-25  6:11         ` Sam Ravnborg
2019-06-25  6:11           ` Sam Ravnborg
2019-06-25  6:11           ` Sam Ravnborg
2019-06-27  3:36           ` Masahiro Yamada
2019-06-27  3:36             ` Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.