build: Fix inter-directory dependencies
[libguestfs.git] / haskell / Makefile.am
index dcaf18a..1836a14 100644 (file)
 # 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