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