From patchwork Fri Jan 15 13:22:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 8040511 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4212BBEEED for ; Fri, 15 Jan 2016 13:26:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5D5CF20458 for ; Fri, 15 Jan 2016 13:26:04 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2E5920459 for ; Fri, 15 Jan 2016 13:26:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK4LV-0003ko-89; Fri, 15 Jan 2016 13:23:17 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aK4LU-0003iy-91 for xen-devel@lists.xen.org; Fri, 15 Jan 2016 13:23:16 +0000 Received: from [85.158.143.35] by server-3.bemta-4.messagelabs.com id 8C/9E-31122-3C2F8965; Fri, 15 Jan 2016 13:23:15 +0000 X-Env-Sender: prvs=815b692d9=Ian.Campbell@citrix.com X-Msg-Ref: server-10.tower-21.messagelabs.com!1452864187!10300782!4 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36599 invoked from network); 15 Jan 2016 13:23:14 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-10.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 15 Jan 2016 13:23:14 -0000 X-IronPort-AV: E=Sophos;i="5.22,299,1449532800"; d="scan'208";a="331644568" From: Ian Campbell To: , , Date: Fri, 15 Jan 2016 13:22:42 +0000 Message-ID: <1452864188-2417-4-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452864188-2417-1-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 X-DLP: MIA2 Cc: Ian Campbell Subject: [Xen-devel] [PATCH XEN v8 03/29] tools: Arrange to check public headers for ANSI compatiblity X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00, RCVD_IN_BRBL_LASTEXT, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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