Skip to contentSkip to conversation

libxl: fix api check Makefile

PATCH In review Ian Jackson 2 participants 7 messages Aug 31, 2012 – Sep 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 .gitignore           |    2 +-
 tools/libxl/Makefile |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
.gitignore +1 -1
index 084ec62..2d56e70 100644
@@ -189,7 +189,7 @@ 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/libaio/src/*.ol
 tools/libaio/src/*.os
 tools/misc/cpuperf/cpuperf-perfcntr
tools/libxl/Makefile +5 -3
index 22c4881..a9d9ec6 100644
@@ -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 \
 		>[email protected]
-	$(call move-if-changed,[email protected],$@)
+	mv -f [email protected] $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" [email protected] >[email protected]
@@ -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
 
Signature · 1 line
tg: (f86a047..) t/xen/xl.api-check-makefile (depends on: t/xen/xl.cfg.no-final-newline-ok)
Acked-by on v1 1/1
#1 lore raw
Quoted 46 lines · Ian Jackson

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.

---
 .gitignore           |    2 +-
 tools/libxl/Makefile |    8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
.gitignore +1 -1
index 084ec62..2d56e70 100644
@@ -189,7 +189,7 @@ 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/libaio/src/*.ol
 tools/libaio/src/*.os
 tools/misc/cpuperf/cpuperf-perfcntr
tools/libxl/Makefile +2 -1
index 22c4881..a9d9ec6 100644
@@ -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.
 

tools/libxl/Makefile $(eval $(genpath-target)) · line 120

Quoted 4 lines
tools/libxl/Makefile +1 -0
@@ -116,12 +117,13 @@ $(eval $(genpath-target))
 
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
+	touch $@

libxl.api-ok needs to either go in .*ignore or start with an _.

Otherwise this looks good:

Quoted 19 lines
tools/libxl/Makefile +2 -2
 _%.api-for-check: %.h
 	$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_$*.o) -c -E $< $(APPEND_CFLAGS) \
 		-DLIBXL_EXTERNAL_CALLERS_ONLY=LIBXL_EXTERNAL_CALLERS_ONLY \
 		>[email protected]
-	$(call move-if-changed,[email protected],$@)
+	mv -f [email protected] $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" [email protected] >[email protected]
@@ -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
 
author Acked-by Ian Campbell
#2 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix api check Makefile"):

Quoted 7 lines · Ian Jackson

Review $(eval $(genpath-target)) · line 119

Quoted 4 lines
(quoted diff) +1 -0
@@ -116,12 +117,13 @@ $(eval $(genpath-target))
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
+	touch $@

libxl.api-ok needs to either go in .*ignore or start with an _.

Duh, don't know how I missed that.

Quoted 2 lines

Otherwise this looks good:

From: Ian Jackson <[email protected]>
Subject: [PATCH v2] 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.

--
v2: add api-ok to gitignore

---
 .gitignore           |    3 ++-
 tools/libxl/Makefile |    8 +++++---
 2 files changed, 7 insertions(+), 4 deletions(-)
.gitignore +2 -1
index 084ec62..776e4b2 100644
@@ -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
tools/libxl/Makefile +5 -3
index 22c4881..a9d9ec6 100644
@@ -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 \
 		>[email protected]
-	$(call move-if-changed,[email protected],$@)
+	mv -f [email protected] $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" [email protected] >[email protected]
@@ -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
 
Signature · 1 line
tg: (f86a047..) t/xen/xl.api-check-makefile (depends on: t/xen/xl.cfg.no-final-newline-ok)
#3 lore raw
Quoted 26 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix api check Makefile"):

Quoted 7 lines · Ian Jackson

tools/libxl/Makefile $(eval $(genpath-target)) · line 119

Quoted 4 lines
tools/libxl/Makefile +1 -0
@@ -116,12 +117,13 @@ $(eval $(genpath-target))
 libxl.api-ok: check-libxl-api-rules _libxl.api-for-check
 	$(PERL) $^
+	touch $@

libxl.api-ok needs to either go in .*ignore or start with an _.

Duh, don't know how I missed that.

Quoted 2 lines

Otherwise this looks good:

From: Ian Jackson <[email protected]>
Subject: [PATCH v2] 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.

Quoted 7 lines

Also fix .gitignore.

--
v2: add api-ok to gitignore

Needs to be in hgignore too. Sorry!

#4 lore raw

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix api check Makefile"):

Quoted 1 line

Needs to be in hgignore too. Sorry!

I was just fixing what was in front of my nose, but fine:

Ian.

From: Ian Jackson <[email protected]>
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.

--
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(-)
.gitignore +2 -1
index 084ec62..776e4b2 100644
@@ -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
.hgignore +1 -0
index 5ef6838..141809e 100644
@@ -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$
tools/libxl/Makefile +5 -3
index 22c4881..a9d9ec6 100644
@@ -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 \
 		>[email protected]
-	$(call move-if-changed,[email protected],$@)
+	mv -f [email protected] $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" [email protected] >[email protected]
@@ -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
 
Signature · 1 line
tg: (f86a047..) t/xen/xl.api-check-makefile (depends on: t/xen/xl.cfg.no-final-newline-ok)
Acked-by
#5 lore raw
Quoted 14 lines · Ian Jackson

Ian Campbell writes ("Re: [Xen-devel] [PATCH] libxl: fix api check Makefile"):

Quoted 1 line

Needs to be in hgignore too. Sorry!

I was just fixing what was in front of my nose, but fine:

Ian.

From: Ian Jackson <[email protected]>
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".

Quoted 8 lines

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.

Quoted 75 lines

--
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(-)
.gitignore +2 -1
index 084ec62..776e4b2 100644
@@ -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
.hgignore +1 -0
index 5ef6838..141809e 100644
@@ -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$
tools/libxl/Makefile +5 -3
index 22c4881..a9d9ec6 100644
@@ -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 \
 		>[email protected]
-	$(call move-if-changed,[email protected],$@)
+	mv -f [email protected] $@
 
 _paths.h: genpath
 	sed -e "s/\([^=]*\)=\(.*\)/#define \1 \2/g" [email protected] >[email protected]
@@ -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