X-Git-Url: http://git.annexia.org/?p=libguestfs.git;a=blobdiff_plain;f=haskell%2FMakefile.am;h=5c1ff9878f5801b7552ff0c24e0b817eb3a89030;hp=1086ee979098c62645daea7a04ccf6650e42838e;hb=HEAD;hpb=a1e8cdf2a254c5eddaf525cd7c34e4c937690204 diff --git a/haskell/Makefile.am b/haskell/Makefile.am index 1086ee9..5c1ff98 100644 --- a/haskell/Makefile.am +++ b/haskell/Makefile.am @@ -13,30 +13,49 @@ # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -EXTRA_DIST = *.hs +include $(top_srcdir)/subdir-rules.mk -CLEANFILES = *~ +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 if HAVE_HASKELL TESTS_ENVIRONMENT = \ LD_LIBRARY_PATH=$(top_builddir)/src/.libs \ LIBGUESTFS_PATH=$(top_builddir)/appliance \ + TMPDIR=$(top_builddir) \ $(VG) -TESTS = Guestfs005Load Guestfs010Launch Guestfs050LVCreate +TESTS = run-bindtests Guestfs005Load Guestfs010Basic + +check_DATA = Bindtests + +GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs -i$(srcdir) -GHCFLAGS = -I$(abs_top_builddir)/src -L$(abs_top_builddir)/src/.libs +all_targets = Bindtests Guestfs005Load Guestfs010Basic +$(all_targets): $(top_builddir)/src/libguestfs.la -Guestfs005Load: Guestfs005Load.hs Guestfs.hs +all: $(all_targets) + +Guestfs.o: $(srcdir)/Guestfs.hs + $(GHC) $(GHCFLAGS) -c $< -o $@ + +Bindtests: $(srcdir)/Bindtests.hs Guestfs.o $(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs -Guestfs010Launch: Guestfs010Launch.hs Guestfs.hs +Guestfs005Load: $(srcdir)/Guestfs005Load.hs Guestfs.o $(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs -Guestfs050LVCreate: Guestfs050LVCreate.hs Guestfs.hs +Guestfs010Basic: $(srcdir)/Guestfs010Basic.hs Guestfs.o $(GHC) $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs -endif \ No newline at end of file +CLEANFILES = $(all_targets) *~ *.hi *.o + +endif