diff options
author | Matthew Booth <mbooth@redhat.com> | 2009-11-19 16:10:00 +0000 |
---|---|---|
committer | Richard Jones <rjones@redhat.com> | 2009-11-19 16:40:22 +0000 |
commit | c477e2fb78347728aaacbbc89666dcda1481a4b9 (patch) | |
tree | 125a0e0b2596cc9f9ad44fa57199522f4c0de804 /haskell | |
parent | 16c1b3164698900f52294e1396542ddd94a4cae4 (diff) | |
download | libguestfs-c477e2fb78347728aaacbbc89666dcda1481a4b9.tar.gz libguestfs-c477e2fb78347728aaacbbc89666dcda1481a4b9.tar.xz libguestfs-c477e2fb78347728aaacbbc89666dcda1481a4b9.zip |
build: Fix inter-directory dependencies
This change adds an explicit dependency on generator.ml for every file it
generates, except java files. Java is left for another time because it's
considerably trickier.
It also adds a build rule for src/libguestfs.la so it can be rebuilt as required
from other directories.
It does this by creating a top level make file, subdir-rules.mk, which can be
included from sub-directories. sub-directories need to define 'generator_built'
to include local files which are built by generator.ml, and they will be updated
automatically.
This fixes parallel make, and will automatically re-create generated files when
make is run from any directory.
It also fixes the problem which efad4f53 was targetting. Specifically,
src/guestfs_protocol.(c|h) had an erroneous dependency on stamp-generator, and
therefore generator.ml, despite not being directly created by it. This caused
them to be recreated every time generator.ml ran rather than only when
src/guestfs_protocol.x was updated, which cascaded into a daemon and therefore
appliance update.
This patch also changes the contents of the distribution tarball by including
files created by rpcgen.
Diffstat (limited to 'haskell')
-rw-r--r-- | haskell/Makefile.am | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/haskell/Makefile.am b/haskell/Makefile.am index dcaf18a5..1836a147 100644 --- a/haskell/Makefile.am +++ b/haskell/Makefile.am @@ -15,7 +15,15 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -EXTRA_DIST = *.hs run-bindtests +include $(top_srcdir)/subdir-rules.mk + +generator_built = \ + Guestfs.hs \ + Bindtests.hs + +# $(generator_built) isn't redundant below as the wildcard rule won't match, and +# therefore won't generate, the files if they haven't been created yet +EXTRA_DIST = $(generator_built) *.hs run-bindtests CLEANFILES = *~ @@ -32,6 +40,8 @@ check_DATA = Bindtests GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs +all: Bindtests Guestfs005Load Guestfs010Launch Guestfs050LVCreate + Bindtests: Bindtests.hs Guestfs.hs $(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs |