regressions: Enable both tests for bug 576879 (not fixed).
[libguestfs.git] / haskell / Makefile.am
1 # libguestfs Haskell bindings
2 # Copyright (C) 2009 Red Hat Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 generator_built = \
21         Guestfs.hs \
22         Bindtests.hs
23
24 # $(generator_built) isn't redundant below as the wildcard rule won't match, and
25 # therefore won't generate, the files if they haven't been created yet
26 EXTRA_DIST = $(generator_built) *.hs run-bindtests
27
28 if HAVE_HASKELL
29
30 TESTS_ENVIRONMENT = \
31         LD_LIBRARY_PATH=$(top_builddir)/src/.libs \
32         LIBGUESTFS_PATH=$(top_builddir)/appliance \
33         $(VG)
34
35 TESTS = run-bindtests Guestfs005Load Guestfs010Basic
36
37 check_DATA = Bindtests
38
39 GHCFLAGS = -I$(top_builddir)/src -L$(top_builddir)/src/.libs
40
41 all_targets = Bindtests Guestfs005Load Guestfs010Basic
42 $(all_targets): $(top_builddir)/src/libguestfs.la
43
44 all: $(all_targets)
45
46 Guestfs.o: Guestfs.hs
47         $(GHC)  $(GHCFLAGS) -c $<
48
49 Bindtests: Bindtests.hs Guestfs.o
50         $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
51
52 Guestfs005Load: Guestfs005Load.hs Guestfs.o
53         $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
54
55 Guestfs010Basic: Guestfs010Basic.hs Guestfs.o
56         $(GHC)  $(GHCFLAGS) -main-is $(shell basename $@) --make -o $@ $< -lguestfs
57
58 CLEANFILES = $(all_targets) *~ *.hi *.o
59
60 endif