generator: Make 'xz' into an optional group.
[libguestfs.git] / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009-2010 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 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 regressions test-tool
34
35 # Guestfish.
36 SUBDIRS += fish 
37
38 # Language bindings.
39 if HAVE_PERL
40 SUBDIRS += perl
41 endif
42 if HAVE_OCAML
43 SUBDIRS += ocaml ocaml/examples
44 endif
45 if HAVE_PYTHON
46 SUBDIRS += python
47 endif
48 if HAVE_RUBY
49 SUBDIRS += ruby
50 endif
51 if HAVE_JAVA
52 SUBDIRS += java
53 endif
54 if HAVE_HASKELL
55 SUBDIRS += haskell
56 endif
57
58 # Virt-inspector, tools and guestmount.
59 if HAVE_INSPECTOR
60 SUBDIRS += inspector
61 endif
62
63 if HAVE_TOOLS
64 SUBDIRS += tools
65 endif
66
67 if HAVE_FUSE
68 SUBDIRS += fuse
69 endif
70
71 EXTRA_DIST = \
72         $(generator_built) \
73         html/pod.css \
74         HACKING TODO \
75         libguestfs.pc libguestfs.pc.in \
76         recipes/LICENSE \
77         recipes/README \
78         recipes/*.html \
79         recipes/*.sh \
80         recipes/*.example \
81         html/recipes.css \
82         make-recipes.sh \
83         contrib/README \
84         bindtests \
85         .gitignore \
86         m4/.gitignore
87
88 # HTML versions of manual pages.
89
90 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
91
92 html/guestfs.3.html: src/guestfs.pod \
93                 src/guestfs-actions.pod \
94                 src/guestfs-availability.pod \
95                 src/guestfs-structs.pod
96         mkdir -p html
97         sed \
98           -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
99           -e 's/@ACTIONS@//' \
100           -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
101           -e 's/@AVAILABILITY@//' \
102           -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
103           -e 's/@STRUCTS@//' \
104           < $< | \
105         pod2html \
106           --css 'pod.css' \
107           --title "libguestfs API documentation" \
108           --htmldir html \
109           --outfile $@
110
111 html/guestfish.1.html: fish/guestfish.pod fish/guestfish-actions.pod
112         mkdir -p html
113         sed \
114           -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
115           < $< | \
116         pod2html \
117           --css 'pod.css' \
118           --title "guestfish, libguestfs filesystem interactive shell" \
119           --htmldir html \
120           --outfile $@
121
122 # Recipes web page.
123 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
124         mkdir -p html
125         rm -f $@ $@-t
126         sh make-recipes.sh recipes/*.sh > $@-t
127         mv $@-t $@
128
129 HTMLFILES = \
130         html/guestfs.3.html \
131         html/guestfish.1.html \
132         html/guestmount.1.html \
133         html/virt-cat.1.html \
134         html/virt-df.1.html \
135         html/virt-edit.1.html \
136         html/virt-inspector.1.html \
137         html/virt-list-filesystems.1.html \
138         html/virt-list-partitions.1.html \
139         html/virt-ls.1.html \
140         html/virt-make-fs.1.html \
141         html/virt-rescue.1.html \
142         html/virt-resize.1.html \
143         html/virt-tar.1.html \
144         html/virt-win-reg.1.html \
145         html/recipes.html \
146         html/pod.css html/recipes.css
147
148 TEXTFILES = README TODO HACKING
149
150 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
151
152 website: $(HTMLFILES) $(TEXTFILES)
153         cp $(HTMLFILES) $(WEBSITEDIR)
154         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
155         cd $(WEBSITEDIR) && \
156         date=`date +%F`; \
157         sed -e "s/SUBST_VERSION/$(VERSION)/" \
158             -e "s/SUBST_DATE/$$date/" \
159         < index.html.in > index.html
160
161 # When doing 'make dist' update a few files automatically.
162 dist-hook:
163         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
164         cp ChangeLog $(distdir)/ChangeLog
165         $(top_srcdir)/update-bugs > BUGS-t
166         mv BUGS-t BUGS
167         cp BUGS $(distdir)/BUGS
168
169 # Update the list of translatable files in po/POTFILES.in.
170 all-local:
171         cd $(srcdir); \
172         find $(DIST_SUBDIRS) \
173             -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
174         grep -v '^perl/blib/' | \
175         grep -v '^capitests/' | \
176         grep -v '^daemon/lib/' | \
177         grep -v '^daemon/tests/' | \
178         grep -v '^examples/' | \
179         grep -v '^gnulib/' | \
180         grep -v '^perl/examples/' | \
181         grep -v '/guestfs_protocol.c' | \
182         grep -v '/rc_protocol.c' | \
183         grep -v 'appliance/debian/root' | \
184         LC_ALL=C sort | \
185         sed 's,^\./,,' > po/POTFILES.in
186
187 # Pkgconfig.
188
189 pkgconfigdir = $(libdir)/pkgconfig
190 pkgconfig_DATA = libguestfs.pc
191
192 # Make clean.
193
194 CLEANFILES = $(fs_DATA) \
195         emptydisk \
196         pod2htm?.tmp \
197         html/*.html \
198         guestfs.3 guestfish.1
199
200 clean-local:
201         rm -rf initramfs
202
203 # If you don't want to run all of the tests ('make check') then this
204 # will just run libguestfs-test-tool for a quick check.  Note this
205 # is NOT a substitute for proper testing!
206
207 quickcheck:
208         LIBGUESTFS_PATH=appliance \
209         test-tool/libguestfs-test-tool \
210           --helper test-tool/libguestfs-test-tool-helper