author: Masahiro Yamada <yamada.masahiro@socionext.com> 2019-11-07 16:14:40 +0900
committer: Masahiro Yamada <yamada.masahiro@socionext.com> 2019-11-15 00:22:35 +0900
commit: fcbb8461fd2376ba3782b5b8bd440c929b8e4980
parent: eba19032f99c32ecfbe23ce99bb1546db0a23bee
Commit Summary:
Diffstat:
1 file changed, 6 insertions, 4 deletions
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 3e1adab089a4..325f4d0f2e73 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -95,9 +95,13 @@ endif
# asm-generic/*.h is used by asm/*.h, and should not be included directly
header-test- += asm-generic/%
-# The rest are compile-tested
-header-test-y += $(filter-out $(header-test-), \
- $(patsubst $(obj)/%,%, $(wildcard \
- $(addprefix $(obj)/, *.h */*.h */*/*.h */*/*/*.h))))
+extra-y := $(patsubst %.h,%.hdrtest, $(filter-out $(header-test-), \
+ $(patsubst $(obj)/%,%, $(shell find $(obj) -name '*.h'))))
+
+quiet_cmd_hdrtest = HDRTEST $<
+ cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
+
+$(obj)/%.hdrtest: $(obj)/%.h FORCE
+ $(call if_changed_dep,hdrtest)
clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*)))