tests: Rename extratests -> tests/extra.
[libguestfs.git] / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009-2011 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 include $(top_srcdir)/subdir-rules.mk
19
20 ACLOCAL_AMFLAGS = -I m4
21
22 # Basic source for the library.
23 SUBDIRS = gnulib/lib images generator src examples po
24
25 if ENABLE_DAEMON
26 SUBDIRS += daemon
27 endif
28 if ENABLE_APPLIANCE
29 SUBDIRS += appliance
30 endif
31
32 # Tests and the test-tool.
33 SUBDIRS += gnulib/tests tests/c-api tests/qemu
34 SUBDIRS += tests/protocol tests/lvm tests/luks tests/md
35 SUBDIRS += tests/regressions
36 SUBDIRS += tests/extra test-tool
37
38 # Guestfish.
39 SUBDIRS += fish
40
41 # virt-tools in C.
42 SUBDIRS += align cat df edit inspector rescue
43
44 # Language bindings.
45 if HAVE_PERL
46 SUBDIRS += perl perl/examples
47 endif
48 if HAVE_OCAML
49 SUBDIRS += ocaml ocaml/examples
50 endif
51 if HAVE_PYTHON
52 SUBDIRS += python python/examples
53 endif
54 if HAVE_RUBY
55 SUBDIRS += ruby ruby/examples
56 endif
57 if HAVE_JAVA
58 SUBDIRS += java java/examples
59 endif
60 if HAVE_HASKELL
61 SUBDIRS += haskell
62 endif
63 if HAVE_PHP
64 SUBDIRS += php
65 endif
66 if HAVE_ERLANG
67 SUBDIRS += erlang erlang/examples
68 endif
69
70 # Unconditional because nothing is built yet.
71 SUBDIRS += csharp
72
73 # virt-resize (new version) and virt-sparsify are written in OCaml.
74 if HAVE_OCAML
75 SUBDIRS += resize sparsify
76 endif
77
78 # Perl tools.
79 if HAVE_TOOLS
80 SUBDIRS += tools
81 endif
82
83 # guestmount
84 if HAVE_FUSE
85 SUBDIRS += fuse
86 endif
87
88 # virt-tools in shell.  This uses guestmount and virt-inspector.
89 if HAVE_FUSE
90 SUBDIRS += clone
91 endif
92
93 # po-docs must come after tools, inspector.
94 if HAVE_PO4A
95 SUBDIRS += po-docs
96 endif
97
98 EXTRA_DIST = \
99         $(generator_built) \
100         BUGS HACKING RELEASE-NOTES ROADMAP TODO \
101         .gitignore \
102         bugs-in-changelog.sh \
103         autogen.sh \
104         bindtests \
105         contrib/autobuild/autobuild.sh \
106         contrib/guestfsd-in-wine.sh \
107         contrib/intro/libguestfs-intro.html \
108         contrib/intro/overview.svg \
109         contrib/intro/talk.txt \
110         contrib/intro/tools.svg \
111         contrib/README \
112         contrib/visualize-alignment/.gitignore \
113         contrib/visualize-alignment/guestfish-add-mount.qtr \
114         contrib/visualize-alignment/guestfish-lv-ext4-4k.qtr \
115         contrib/visualize-alignment/guestfish-lv-ext4-4k-write-hello.qtr \
116         contrib/visualize-alignment/guestfish-N-fs-10M-aligned-part-disk.qtr \
117         contrib/visualize-alignment/guestfish-N-fs-10M.qtr \
118         contrib/visualize-alignment/guestfish-write-hello.qtr \
119         contrib/visualize-alignment/qemu-0.13-trace-block-device-access.patch \
120         contrib/visualize-alignment/README \
121         contrib/visualize-alignment/tracetops.ml \
122         debian/.gitignore \
123         debian/changelog \
124         debian/compat \
125         debian/control \
126         debian/copyright \
127         debian/docs \
128         debian/guestfish.dirs \
129         debian/guestfish.install \
130         debian/guestfsd.dirs \
131         debian/guestfsd.install \
132         debian/guestmount.dirs \
133         debian/guestmount.install \
134         debian/libguestfs-dev.dirs \
135         debian/libguestfs-dev.install \
136         debian/libguestfs-doc.docs \
137         debian/libguestfs-perl.examples \
138         debian/libguestfs-perl.install \
139         debian/libguestfs-tools.dirs \
140         debian/libguestfs-tools.install \
141         debian/libguestfs0.dirs \
142         debian/libguestfs0.install \
143         debian/patches/series \
144         debian/python-guestfs.install \
145         debian/pyversions \
146         debian/rules \
147         debian/shlibs.local \
148         debian/watch \
149         html/pod.css \
150         libguestfs.pc libguestfs.pc.in \
151         libtool-kill-dependency_libs.sh \
152         logo/fish.svg logo/fish.png \
153         m4/.gitignore \
154         run \
155         update-bugs.sh
156
157 HTMLFILES = \
158         html/guestfs.3.html \
159         html/guestfs-examples.3.html \
160         html/guestfs-erlang.3.html \
161         html/guestfs-java.3.html \
162         html/guestfs-ocaml.3.html \
163         html/guestfs-perl.3.html \
164         html/guestfs-python.3.html \
165         html/guestfs-recipes.1.html \
166         html/guestfs-ruby.3.html \
167         html/guestfs-testing.1.html \
168         html/guestfish.1.html \
169         html/guestmount.1.html \
170         html/virt-alignment-scan.1.html \
171         html/virt-cat.1.html \
172         html/virt-copy-in.1.html \
173         html/virt-copy-out.1.html \
174         html/virt-df.1.html \
175         html/virt-edit.1.html \
176         html/virt-filesystems.1.html \
177         html/virt-inspector.1.html \
178         html/virt-list-filesystems.1.html \
179         html/virt-list-partitions.1.html \
180         html/virt-ls.1.html \
181         html/virt-make-fs.1.html \
182         html/virt-rescue.1.html \
183         html/virt-resize.1.html \
184         html/virt-sparsify.1.html \
185         html/virt-sysprep.1.html \
186         html/virt-tar.1.html \
187         html/virt-tar-in.1.html \
188         html/virt-tar-out.1.html \
189         html/virt-win-reg.1.html
190
191 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
192
193 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
194
195 website: $(HTMLFILES) $(TEXTFILES)
196         cp $(HTMLFILES) $(WEBSITEDIR)
197         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
198         cd $(WEBSITEDIR) && \
199         date=`date +%F`; \
200         sed -e "s/SUBST_VERSION/$(VERSION)/" \
201             -e "s/SUBST_DATE/$$date/" \
202         < index.html.in > index.html
203
204 # When doing 'make dist' update a few files automatically.
205 dist-hook:
206         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
207         cp ChangeLog $(distdir)/ChangeLog
208         $(top_srcdir)/update-bugs.sh > BUGS-t
209         mv BUGS-t BUGS
210         cp BUGS $(distdir)/BUGS
211         git log --pretty="format:%an" | sort -u | \
212                 grep -v rjones | \
213                 grep -v "Richard Jones" \
214                 > AUTHORS-t
215         mv AUTHORS-t AUTHORS
216         cp AUTHORS $(distdir)/AUTHORS
217
218 # Update the list of translatable files in po/POTFILES.in.
219 all-local:
220         cd $(srcdir); \
221         find $(DIST_SUBDIRS) \
222             -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
223         grep -v '^perl/blib/' | \
224         grep -v '^tests/' | \
225         grep -v '^daemon/lib/' | \
226         grep -v '^daemon/tests/' | \
227         grep -v '^examples/' | \
228         grep -v '^gnulib/' | \
229         grep -v '^perl/examples/' | \
230         grep -v '/guestfs_protocol.c' | \
231         grep -v '/rc_protocol.c' | \
232         grep -v 'appliance/debian/root' | \
233         grep -v '^po-docs/' | \
234         grep -v '^images/' | \
235         LC_ALL=C sort | \
236         sed 's,^\./,,' > po/POTFILES.in
237
238 # Pkgconfig.
239
240 pkgconfigdir = $(libdir)/pkgconfig
241 pkgconfig_DATA = libguestfs.pc
242
243 # Make clean.
244
245 CLEANFILES = \
246         pod2htm?.tmp \
247         html/*.html
248
249 # If you don't want to run all of the tests ('make check') then this
250 # will just run libguestfs-test-tool for a quick check.  Note this
251 # is NOT a substitute for proper testing!
252
253 quickcheck:
254         ./run test-tool/libguestfs-test-tool $(QUICKCHECK_TEST_TOOL_ARGS)
255
256 # Run extra-tests in tests/extra/ subdirectory.
257
258 extra-tests:
259         make -C tests/extra $@
260
261 # Make binary distribution.
262
263 BINTMPDIR = /tmp/libguestfs-bin
264 bindist:
265         rm -rf $(BINTMPDIR)
266         mkdir $(BINTMPDIR)
267         $(MAKE)
268         $(MAKE) DESTDIR=$(BINTMPDIR) install
269         -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
270         (cd $(BINTMPDIR) && tar cf - .) | \
271           gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz