From: Ian Campbell Date: Thu, 11 Jun 2015 12:18:18 +0000 (+0100) Subject: tools: Arrange to check public headers for ANSI compatiblity X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~1898 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aae392b46c1d04665b8d903122b5059332ad6903;p=xen.git tools: Arrange to check public headers for ANSI compatiblity Using the same rune as we use for the Xen public headers, except we do not need stdint.h here. Signed-off-by: Ian Campbell Acked-by: Wei Liu --- diff --git a/.gitignore b/.gitignore index e7af9f7d31..7340a5686b 100644 --- a/.gitignore +++ b/.gitignore @@ -87,6 +87,8 @@ tools/config.cache config/Tools.mk config/Stubdom.mk config/Docs.mk +tools/libs/toollog/headers.chk +tools/libs/evtchn/headers.chk tools/blktap2/daemon/blktapctrl tools/blktap2/drivers/img2qcow tools/blktap2/drivers/lock-util diff --git a/tools/Rules.mk b/tools/Rules.mk index 75d02c441d..0c83e222ff 100644 --- a/tools/Rules.mk +++ b/tools/Rules.mk @@ -176,6 +176,14 @@ INSTALL_PYTHON_PROG = \ %.opic: %.S $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) $(CFLAGS.opic) -fPIC -c -o $@ $< $(APPEND_CFLAGS) +headers.chk: + for i in $(filter %.h,$^); do \ + $(CC) -x c -ansi -Wall -Werror $(CFLAGS_xeninclude) \ + -S -o /dev/null $$i || exit 1; \ + echo $$i; \ + done >$@.new + mv $@.new $@ + subdirs-all subdirs-clean subdirs-install subdirs-distclean: .phony @set -e; for subdir in $(SUBDIRS) $(SUBDIRS-y); do \ $(MAKE) subdir-$(patsubst subdirs-%,%,$@)-$$subdir; \ diff --git a/tools/libs/evtchn/Makefile b/tools/libs/evtchn/Makefile index 46a807fe3c..991786446f 100644 --- a/tools/libs/evtchn/Makefile +++ b/tools/libs/evtchn/Makefile @@ -32,8 +32,9 @@ build: $(MAKE) libs .PHONY: libs -libs: $(LIB) +libs: headers.chk $(LIB) +headers.chk: $(wildcard include/*.h) libxenevtchn.a: $(LIB_OBJS) $(AR) rc $@ $^ @@ -64,6 +65,7 @@ TAGS: clean: rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS) rm -f libxenevtchn.so.$(MAJOR).$(MINOR) libxenevtchn.so.$(MAJOR) + rm -f headers.chk .PHONY: distclean distclean: clean diff --git a/tools/libs/toollog/Makefile b/tools/libs/toollog/Makefile index 9bfd179ed8..fb701bef42 100644 --- a/tools/libs/toollog/Makefile +++ b/tools/libs/toollog/Makefile @@ -27,7 +27,9 @@ build: $(MAKE) libs .PHONY: libs -libs: $(LIB) +libs: headers.chk $(LIB) + +headers.chk: $(wildcard include/*.h) libxentoollog.a: $(LIB_OBJS) $(AR) rc $@ $^ @@ -58,6 +60,7 @@ TAGS: clean: rm -rf *.rpm $(LIB) *~ $(DEPS) $(LIB_OBJS) $(PIC_OBJS) rm -f libxentoollog.so.$(MAJOR).$(MINOR) libxentoollog.so.$(MAJOR) + rm -f headers.chk .PHONY: distclean distclean: clean