From: Ian Jackson Subject: Re: [PATCH] libxl: fix api check Makefile Date: Fri, 31 Aug 2012 16:14:58 +0100 Message-ID: <20544.54514.22038.727353@mariner.uk.xensource.com> References: <20544.52351.298163.138907@mariner.uk.xensource.com> <1346425084.27277.220.camel@zakaz.uk.xensource.com> <20544.54022.744391.866200@mariner.uk.xensource.com> <1346425723.27277.228.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1346425723.27277.228.camel@zakaz.uk.xensource.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 Campbell Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix api check Makefile"): > Needs to be in hgignore too. Sorry! I was just fixing what was in front of my nose, but fine: Ian. From: Ian Jackson Subject: [PATCH v3] libxl: fix api check Makefile Touch the libxl.api-ok stamp file, and unconditionally put in place the new _libxl.api-for-check. This avoids needlessly rerunning the preprocessor on libxl.h each time we call "make". Ensure that _libxl.api-for-check gets the CFLAGS used for xl, so that if it is asked for in a standalone make run it can find xentoollog.h. Remove *.api-ok on clean. Also fix .gitignore. Signed-off-by: Ian Jackson -- v3: add api-ok to hgignore v2: add api-ok to gitignore --- .gitignore | 3 ++- .hgignore | 1 + tools/libxl/Makefile | 8 +++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 084ec62..776e4b2 100644 --- a/.gitignore +++ b/.gitignore @@ -189,7 +189,8 @@ tools/libxl/xl tools/libxl/testenum tools/libxl/testenum.c tools/libxl/tmp.* -tools/libxl/libxl.api-for-check +tools/libxl/_libxl.api-for-check +tools/libxl/*.api-ok tools/libaio/src/*.ol tools/libaio/src/*.os tools/misc/cpuperf/cpuperf-perfcntr diff --git a/.hgignore b/.hgignore index 5ef6838..141809e 100644 --- a/.hgignore +++ b/.hgignore @@ -188,6 +188,7 @@ ^tools/libxl/tmp\..*$ ^tools/libxl/.*\.new$ ^tools/libxl/_libxl\.api-for-check +^tools/libxl/libxl\.api-ok ^tools/libvchan/vchan-node[12]$ ^tools/libaio/src/.*\.ol$ ^tools/libaio/src/.*\.os$ diff --git a/tools/libxl/Makefile b/tools/libxl/Makefile index 22c4881..a9d9ec6 100644 --- a/tools/libxl/Makefile +++ b/tools/libxl/Makefile @@ -85,7 +85,8 @@ $(LIBXLU_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h CLIENTS = xl testidl libxl-save-helper XL_OBJS = xl.o xl_cmdimpl.o xl_cmdtable.o xl_sxp.o -$(XL_OBJS): CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h +$(XL_OBJS) _libxl.api-for-check: \ + CFLAGS += $(CFLAGS_libxenctrl) # For xentoollog.h $(XL_OBJS): CFLAGS += $(CFLAGS_libxenlight) $(XL_OBJS): CFLAGS += -include $(XEN_ROOT)/tools/config.h # libxl_json.h needs it. @@ -116,12 +117,13 @@ $(eval $(genpath-target)) libxl.api-ok: check-libxl-api-rules _libxl.api-for-check $(PERL) $^ + touch $@ _%.api-for-check: %.h $(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \ -DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \ >$@.new - $(call move-if-changed,$@.new,$@) + mv -f $@.new $@ _paths.h: genpath sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" $@.tmp >$@.2.tmp @@ -211,7 +213,7 @@ install: all clean: $(RM) -f _*.h *.o *.so* *.a $(CLIENTS) $(DEPS) $(RM) -f _*.c *.pyc _paths.*.tmp _*.api-for-check - $(RM) -f testidl.c.new testidl.c + $(RM) -f testidl.c.new testidl.c *.api-ok distclean: clean -- tg: (f86a047..) t/xen/xl.api-check-makefile (depends on: t/xen/xl.cfg.no-final-newline-ok)