Makefile.am: Fix comment.
[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., 675 Mass Ave, Cambridge, MA 02139, 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 if HAVE_OCAML_PCRE
73 SUBDIRS += resize
74 endif
75 SUBDIRS += 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 # po-docs must come after tools, inspector.
89 if HAVE_PO4A
90 SUBDIRS += po-docs
91 endif
92
93 EXTRA_DIST = \
94         $(generator_built) \
95         BUGS HACKING RELEASE-NOTES ROADMAP TODO \
96         .gitignore \
97         bugs-in-changelog.sh \
98         autogen.sh \
99         bindtests \
100         contrib/README \
101         debian/.gitignore \
102         debian/changelog \
103         debian/compat \
104         debian/control \
105         debian/copyright \
106         debian/docs \
107         debian/guestfish.dirs \
108         debian/guestfish.install \
109         debian/guestfsd.dirs \
110         debian/guestfsd.install \
111         debian/guestmount.dirs \
112         debian/guestmount.install \
113         debian/libguestfs-dev.dirs \
114         debian/libguestfs-dev.install \
115         debian/libguestfs-doc.docs \
116         debian/libguestfs-perl.examples \
117         debian/libguestfs-perl.install \
118         debian/libguestfs-tools.dirs \
119         debian/libguestfs-tools.install \
120         debian/libguestfs0.dirs \
121         debian/libguestfs0.install \
122         debian/patches/series \
123         debian/python-guestfs.install \
124         debian/pyversions \
125         debian/rules \
126         debian/shlibs.local \
127         debian/watch \
128         html/pod.css \
129         libguestfs.pc libguestfs.pc.in \
130         libtool-kill-dependency_libs.sh \
131         logo/fish.svg logo/fish.png \
132         m4/.gitignore \
133         run \
134         update-bugs.sh
135
136 HTMLFILES = \
137         html/guestfs.3.html \
138         html/guestfs-examples.3.html \
139         html/guestfs-erlang.3.html \
140         html/guestfs-java.3.html \
141         html/guestfs-ocaml.3.html \
142         html/guestfs-perl.3.html \
143         html/guestfs-python.3.html \
144         html/guestfs-recipes.1.html \
145         html/guestfs-ruby.3.html \
146         html/guestfish.1.html \
147         html/guestmount.1.html \
148         html/virt-alignment-scan.1.html \
149         html/virt-cat.1.html \
150         html/virt-copy-in.1.html \
151         html/virt-copy-out.1.html \
152         html/virt-df.1.html \
153         html/virt-edit.1.html \
154         html/virt-filesystems.1.html \
155         html/virt-inspector.1.html \
156         html/virt-list-filesystems.1.html \
157         html/virt-list-partitions.1.html \
158         html/virt-ls.1.html \
159         html/virt-make-fs.1.html \
160         html/virt-rescue.1.html \
161         html/virt-resize.1.html \
162         html/virt-sparsify.1.html \
163         html/virt-tar.1.html \
164         html/virt-tar-in.1.html \
165         html/virt-tar-out.1.html \
166         html/virt-win-reg.1.html
167
168 TEXTFILES = BUGS README RELEASE-NOTES ROADMAP TODO
169
170 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
171
172 website: $(HTMLFILES) $(TEXTFILES)
173         cp $(HTMLFILES) $(WEBSITEDIR)
174         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
175         cd $(WEBSITEDIR) && \
176         date=`date +%F`; \
177         sed -e "s/SUBST_VERSION/$(VERSION)/" \
178             -e "s/SUBST_DATE/$$date/" \
179         < index.html.in > index.html
180
181 # When doing 'make dist' update a few files automatically.
182 dist-hook:
183         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
184         cp ChangeLog $(distdir)/ChangeLog
185         $(top_srcdir)/update-bugs.sh > BUGS-t
186         mv BUGS-t BUGS
187         cp BUGS $(distdir)/BUGS
188         git log --pretty="format:%an" | sort -u | \
189                 grep -v rjones | \
190                 grep -v "Richard Jones" \
191                 > AUTHORS-t
192         mv AUTHORS-t AUTHORS
193         cp AUTHORS $(distdir)/AUTHORS
194
195 # Update the list of translatable files in po/POTFILES.in.
196 all-local:
197         cd $(srcdir); \
198         find $(DIST_SUBDIRS) \
199             -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
200         grep -v '^perl/blib/' | \
201         grep -v '^capitests/' | \
202         grep -v '^daemon/lib/' | \
203         grep -v '^daemon/tests/' | \
204         grep -v '^examples/' | \
205         grep -v '^gnulib/' | \
206         grep -v '^perl/examples/' | \
207         grep -v '/guestfs_protocol.c' | \
208         grep -v '/rc_protocol.c' | \
209         grep -v 'appliance/debian/root' | \
210         grep -v '^po-docs/' | \
211         LC_ALL=C sort | \
212         sed 's,^\./,,' > po/POTFILES.in
213
214 # Pkgconfig.
215
216 pkgconfigdir = $(libdir)/pkgconfig
217 pkgconfig_DATA = libguestfs.pc
218
219 # Make clean.
220
221 CLEANFILES = \
222         pod2htm?.tmp \
223         html/*.html
224
225 # If you don't want to run all of the tests ('make check') then this
226 # will just run libguestfs-test-tool for a quick check.  Note this
227 # is NOT a substitute for proper testing!
228
229 quickcheck:
230         ./run test-tool/libguestfs-test-tool $(QUICKCHECK_TEST_TOOL_ARGS)
231
232 # Make binary distribution.
233
234 BINTMPDIR = /tmp/libguestfs-bin
235 bindist:
236         rm -rf $(BINTMPDIR)
237         mkdir $(BINTMPDIR)
238         $(MAKE)
239         $(MAKE) DESTDIR=$(BINTMPDIR) install
240         -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
241         (cd $(BINTMPDIR) && tar cf - .) | \
242           gzip -c -9 > libguestfs-$(VERSION)-$(DISTRO)-$(host_cpu).tar.gz