aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-06-12 21:49:22 -0600
committerEric Blake <eblake@redhat.com>2012-06-12 22:35:55 -0600
commit9b5970c6c4ef267f2ba7d43d8b4d4996659c9fe1 (patch)
tree3484367a7067197439a90439248bb9884bdb3d9f /src/Makefile.am
parentbuild: silence gettext warning (diff)
downloadlibvirt-9b5970c6c4ef267f2ba7d43d8b4d4996659c9fe1.tar.gz
libvirt-9b5970c6c4ef267f2ba7d43d8b4d4996659c9fe1.tar.bz2
libvirt-9b5970c6c4ef267f2ba7d43d8b4d4996659c9fe1.zip
build: fix 'make dist' on virgin checkout
'make dist' was depending on *protocol-structs files, which are stored in git but in turn depended on generated files. We still want to ship the protocol-structs files, but by renaming the tests to something not matching a file name, we separate 'make check' (which depends on the generated file) from 'make dist' (which only depends on the git files). After all, the tarball should never depend on a generated file not stored in git. I found one more case of a git file depending on a generated file, in a bogus virkeycode.c listing; but at least this one had no associated rules so it never broke 'make dist'. Reported by Wen Congyang. Latent bug has been present since commit 62dee6f, but only recently exposed by commit 7bff56a. * src/Makefile.am ($(srcdir)/util/virkeycode.c): Drop useless dependency. (BUILT_SOURCES): ...and build virkeymaps.h sooner. (PROTOCOL_STRUCTS): Rather than depend on the struct file... (check-local): ...convert things into a phony target of... (check-protocol): ...a new check. ($(srcdir)/remote_protocol-struct): Rename to isolate the distributed file from the conditional test. (PDWTAGS): Deal with rename. Swap to compare 'expected actual'.
Diffstat (limited to 'src/Makefile.am')
-rw-r--r--src/Makefile.am25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 60f544279..2bcebcfb2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -113,12 +113,12 @@ UTIL_SOURCES = \
EXTRA_DIST += $(srcdir)/util/virkeymaps.h $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeycode-mapgen.py
+BUILT_SOURCES += $(srcdir)/util/virkeymaps.h
+
$(srcdir)/util/virkeymaps.h: $(srcdir)/util/keymaps.csv \
$(srcdir)/util/virkeycode-mapgen.py
$(AM_V_GEN)$(PYTHON) $(srcdir)/util/virkeycode-mapgen.py <$(srcdir)/util/keymaps.csv >$@
-$(srcdir)/util/virkeycode.c: $(srcdir)/util/virkeycode.h $(srcdir)/util/virkeymaps.h
-
EXTRA_DIST += util/threads-pthread.c util/threads-win32.c
# Internal generic driver infrastructure
@@ -293,7 +293,7 @@ PDWTAGS = \
-e '}' \
< $(@F)-t1 > $(@F)-t3; \
case $$? in 8) rm -f $(@F)-t?; exit 0;; 0) ;; *) exit 1;; esac;\
- diff -u $(@F)-t3 $@; st=$$?; rm -f $(@F)-t?; exit $$st; \
+ diff -u $(@)s $(@F)-t3; st=$$?; rm -f $(@F)-t?; exit $$st; \
fi; \
else \
echo 'WARNING: you lack pdwtags; skipping the $@ test' >&2; \
@@ -306,21 +306,24 @@ PROTOCOL_STRUCTS = \
$(srcdir)/virnetprotocol-structs \
$(srcdir)/virkeepaliveprotocol-structs
if WITH_REMOTE
+check-protocol: $(PROTOCOL_STRUCTS) $(PROTOCOL_STRUCTS:structs=struct)
+
# The .o file that pdwtags parses is created as a side effect of running
# libtool; but from make's perspective we depend on the .lo file.
-$(srcdir)/%_protocol-structs: libvirt_driver_remote_la-%_protocol.lo
- $(PDWTAGS)
-$(srcdir)/virnetprotocol-structs: libvirt_net_rpc_la-virnetprotocol.lo
+$(srcdir)/remote_protocol-struct $(srcdir)/qemu_protocol-struct: \
+ $(srcdir)/%-struct: libvirt_driver_remote_la-%.lo
$(PDWTAGS)
-$(srcdir)/virkeepaliveprotocol-structs: libvirt_net_rpc_la-virkeepaliveprotocol.lo
+$(srcdir)/virnetprotocol-struct $(srcdir)/virkeepaliveprotocol-struct: \
+ $(srcdir)/%-struct: libvirt_net_rpc_la-%.lo
$(PDWTAGS)
else !WITH_REMOTE
-# These generated files must live in git, because they cannot be re-generated
-# when configured --without-remote.
-$(PROTOCOL_STRUCTS):
+# The $(PROTOCOL_STRUCTS) files must live in git, because they cannot be
+# re-generated when configured --without-remote.
+check-protocol:
endif
EXTRA_DIST += $(PROTOCOL_STRUCTS)
-check-local: $(PROTOCOL_STRUCTS)
+check-local: check-protocol
+.PHONY: check-protocol $(PROTOCOL_STRUCTS:structs=struct)
# Mock driver, covering domains, storage, networks, etc
TEST_DRIVER_SOURCES = \