]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
tools: Arrange to check public headers for ANSI compatiblity
authorIan Campbell <ian.campbell@citrix.com>
Thu, 11 Jun 2015 12:18:18 +0000 (13:18 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 22 Jan 2016 12:21:39 +0000 (12:21 +0000)
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 <ian.campbell@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
.gitignore
tools/Rules.mk
tools/libs/evtchn/Makefile
tools/libs/toollog/Makefile

index e7af9f7d31cee4e74de33c52625c4629fececb97..7340a5686bf20dc5b03772ef5f3e308cc777d0d1 100644 (file)
@@ -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
index 75d02c441de178c879660de73a83dafadffc41c7..0c83e222ffbf4f7104624b1ba4723476b7bf04fc 100644 (file)
@@ -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; \
index 46a807fe3ccddbaf174a2204a6dbbb0bab6fd436..991786446f043f838d9cfbcf48ba54d587e12293 100644 (file)
@@ -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
index 9bfd179ed8ddba0439ee45823c1d767e9dfdaf3e..fb701bef42bab5c1bc67454176a27d0bd74464e0 100644 (file)
@@ -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