From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH XEN v8 03/29] tools: Arrange to check public headers for ANSI compatiblity Date: Fri, 15 Jan 2016 13:22:42 +0000 Message-ID: <1452864188-2417-4-git-send-email-ian.campbell@citrix.com> References: <1452864168.32341.97.camel@citrix.com> <1452864188-2417-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1452864188-2417-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: ian.jackson@eu.citrix.com, wei.liu2@citrix.com, xen-devel@lists.xen.org Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org 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 --- v7: Drop -pendantic: Some library headers include parts of xen/include/public, which in turn are not -pedantic clean Retained ack, hope that's ok. --- .gitignore | 2 ++ tools/Rules.mk | 8 ++++++++ tools/libs/evtchn/Makefile | 4 +++- tools/libs/toollog/Makefile | 5 ++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f79a7b3..aa92d78 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 75d02c4..0c83e22 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 46a807f..9917864 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 9bfd179..fb701be 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 -- 2.1.4