diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-06-17 07:21:03 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-06-17 07:21:03 +0100 |
commit | 6f1d3ce238905fc7b4c563a3611576ca25a09a49 (patch) | |
tree | 164961c069a3b70d82d0ce105e9a363d71cacaaf /xen/include/Makefile | |
parent | c93bd0e6ea2a0295f56abd4e58cbb0761f299f0d (diff) | |
download | xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.tar.gz xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.tar.bz2 xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.zip |
Introduce mechanism to check standard conformance of headers
While pretty simplistic, it appears to serve the purpose at the moment
(i.e. it spotted two places where a GNU extension was used withou
proper preprocessor conditionals). The "simplistic" here includes that
the checking gets only done for native builds, and ia64 gets excluded
due to its arch-specific header intentionally (for whatever reason)
checking that anonymous struct/unions can be used.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/include/Makefile')
-rw-r--r-- | xen/include/Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xen/include/Makefile b/xen/include/Makefile index 15acff963b..3183e4d244 100644 --- a/xen/include/Makefile +++ b/xen/include/Makefile @@ -1,3 +1,6 @@ +XEN_ROOT:=$(BASEDIR)/.. +include $(XEN_ROOT)/Config.mk + ifneq ($(CONFIG_COMPAT),) compat-arch-$(CONFIG_X86) := x86_32 @@ -35,6 +38,9 @@ suffix-$(CONFIG_X86) := \#pragma pack() endif +public-$(CONFIG_X86) := $(wildcard public/arch-x86/*.h public/arch-x86/*/*.h) +public-$(CONFIG_IA64) := $(wildcard public/arch-ia64/*.h public/arch-ia64/*/*.h) + .PHONY: all all: $(headers-y) @@ -67,5 +73,18 @@ compat/xlat.h: xlat.lst $(filter-out compat/xlat.h,$(headers-y)) $(BASEDIR)/tool done >$@.new mv -f $@.new $@ +ifeq ($(XEN_TARGET_ARCH),$(XEN_COMPILE_ARCH)) +# public/arch-ia64.h explicitly bails on __STRICT_ANSI__ +ifeq ($(CONFIG_IA64),) + +all: headers.chk + +headers.chk: $(filter-out public/arch-% public/%ctl.h public/xsm/% public/%hvm/save.h, $(wildcard public/*.h public/*/*.h) $(public-y)) Makefile + for i in $(filter %.h,$^); do $(CC) -ansi -include stdint.h -Wall -W -Werror -S -o /dev/null -xc $$i || exit 1; echo $$i; done >$@.new + mv $@.new $@ + +endif +endif + clean:: rm -rf compat |