+generator_built = \
+ guestfs_protocol.x \
+ guestfs-structs.h \
+ guestfs-actions.h \
+ guestfs-internal-actions.h \
+ guestfs-actions.c \
+ guestfs-bindtests.c \
+ guestfs-actions.pod \
+ guestfs-availability.pod \
+ guestfs-structs.pod \
+ libguestfs.syms
+
+$(generator_built): stamp-generator
+
+BUILT_SOURCES = \
+ $(generator_built) \
+ guestfs_protocol.c \
+ guestfs_protocol.h
+
+EXTRA_DIST = \
+ $(BUILT_SOURCES) \
+ MAX_PROC_NR \
+ stamp-generator \
+ generator.ml \
+ libguestfs.3
+
+# Rerun the generator if it has changed.
+# Git removes empty directories, so in cases where the
+# generator is creating the sole file in a directory, we
+# have to create the directory first.
+noinst_DATA = stamp-generator
+
+stamp-generator: generator.ml
+ mkdir -p $(top_srcdir)/perl/lib/Sys
+ mkdir -p $(top_srcdir)/ruby/ext/guestfs
+ mkdir -p $(top_srcdir)/java/com/redhat/et/libguestfs
+ mkdir -p $(top_srcdir)/csharp
+ cd $(top_srcdir) && ocaml -warn-error A src/generator.ml