kbuild: move headers_check rule to usr/include/Makefile
Currently, some sanity checks for uapi headers are done by scripts/headers_check.pl, which is wired up to the 'headers_check' target in the top Makefile. It is true compiling headers has better test coverage, but there are still several headers excluded from the compile test. I like to keep headers_check.pl for a while, but we can delete a lot of code by moving the build rule to usr/include/Makefile. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
This commit is contained in:
@@ -95,11 +95,14 @@ endif
|
||||
# asm-generic/*.h is used by asm/*.h, and should not be included directly
|
||||
header-test- += asm-generic/%
|
||||
|
||||
extra-y := $(patsubst %.h,%.hdrtest, $(filter-out $(header-test-), \
|
||||
$(patsubst $(obj)/%,%, $(shell find $(obj) -name '*.h'))))
|
||||
extra-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h'))
|
||||
|
||||
quiet_cmd_hdrtest = HDRTEST $<
|
||||
cmd_hdrtest = $(CC) $(c_flags) -S -o /dev/null -x c /dev/null -include $<; touch $@
|
||||
cmd_hdrtest = \
|
||||
$(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
|
||||
$(if $(filter-out $(header-test-), $*.h), -include $<); \
|
||||
$(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
|
||||
touch $@
|
||||
|
||||
$(obj)/%.hdrtest: $(obj)/%.h FORCE
|
||||
$(call if_changed_dep,hdrtest)
|
||||
|
Reference in New Issue
Block a user