po-docs: Remove virt-inspector.pl reference from Makefile.am.
[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 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 regressions test-tool
34
35 # Guestfish.
36 SUBDIRS += fish
37
38 # virt-tools in C.
39 SUBDIRS += cat inspector
40
41 # Language bindings.
42 if HAVE_PERL
43 SUBDIRS += perl
44 endif
45 if HAVE_OCAML
46 SUBDIRS += ocaml ocaml/examples
47 endif
48 if HAVE_PYTHON
49 SUBDIRS += python
50 endif
51 if HAVE_RUBY
52 SUBDIRS += ruby
53 endif
54 if HAVE_JAVA
55 SUBDIRS += java
56 endif
57 if HAVE_HASKELL
58 SUBDIRS += haskell
59 endif
60 if HAVE_PHP
61 SUBDIRS += php
62 endif
63
64 # Unconditional because nothing is built yet.
65 SUBDIRS += csharp
66
67 # Perl tools and guestmount.
68 if HAVE_TOOLS
69 SUBDIRS += tools
70 endif
71
72 if HAVE_FUSE
73 SUBDIRS += fuse
74 endif
75
76 # po-docs must come after tools, inspector.
77 SUBDIRS += po-docs
78
79 EXTRA_DIST = \
80         $(generator_built) \
81         html/pod.css \
82         BUGS HACKING RELEASE-NOTES TODO \
83         libguestfs.pc libguestfs.pc.in \
84         recipes/LICENSE \
85         recipes/README \
86         recipes/*.html \
87         recipes/*.sh \
88         recipes/*.example \
89         html/recipes.css \
90         make-recipes.sh \
91         contrib/README \
92         bindtests \
93         .gitignore \
94         m4/.gitignore
95
96 # HTML versions of manual pages.
97
98 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
99
100 html/guestfs.3.html: src/guestfs.pod \
101                 src/guestfs-actions.pod \
102                 src/guestfs-availability.pod \
103                 src/guestfs-structs.pod
104         mkdir -p html
105         sed \
106           -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
107           -e 's/@ACTIONS@//' \
108           -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
109           -e 's/@AVAILABILITY@//' \
110           -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
111           -e 's/@STRUCTS@//' \
112           < $< | \
113         pod2html \
114           --css 'pod.css' \
115           --title "libguestfs API documentation" \
116           --htmldir html \
117           --outfile $@
118
119 html/guestfish.1.html: fish/guestfish.pod fish/guestfish-actions.pod fish/guestfish-commands.pod
120         mkdir -p html
121         sed \
122           -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
123           -e '/@FISH_COMMANDS@/rfish/guestfish-commands.pod' -e 's/@FISH_COMMANDS@//' \
124           < $< | \
125         pod2html \
126           --css 'pod.css' \
127           --title "guestfish, libguestfs filesystem interactive shell" \
128           --htmldir html \
129           --outfile $@
130
131 # Recipes web page.
132 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
133         mkdir -p html
134         rm -f $@ $@-t
135         sh make-recipes.sh recipes/*.sh > $@-t
136         mv $@-t $@
137
138 HTMLFILES = \
139         html/guestfs.3.html \
140         html/guestfish.1.html \
141         html/guestmount.1.html \
142         html/virt-cat.1.html \
143         html/virt-df.1.html \
144         html/virt-edit.1.html \
145         html/virt-inspector.1.html \
146         html/virt-list-filesystems.1.html \
147         html/virt-list-partitions.1.html \
148         html/virt-ls.1.html \
149         html/virt-make-fs.1.html \
150         html/virt-rescue.1.html \
151         html/virt-resize.1.html \
152         html/virt-tar.1.html \
153         html/virt-win-reg.1.html \
154         html/recipes.html \
155         html/pod.css html/recipes.css
156
157 TEXTFILES = BUGS HACKING README RELEASE-NOTES TODO
158
159 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
160
161 website: $(HTMLFILES) $(TEXTFILES)
162         cp $(HTMLFILES) $(WEBSITEDIR)
163         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
164         cd $(WEBSITEDIR) && \
165         date=`date +%F`; \
166         sed -e "s/SUBST_VERSION/$(VERSION)/" \
167             -e "s/SUBST_DATE/$$date/" \
168         < index.html.in > index.html
169
170 # When doing 'make dist' update a few files automatically.
171 dist-hook:
172         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
173         cp ChangeLog $(distdir)/ChangeLog
174         $(top_srcdir)/update-bugs > BUGS-t
175         mv BUGS-t BUGS
176         cp BUGS $(distdir)/BUGS
177         git log --pretty="format:%an" | sort -u | \
178                 grep -v rjones | \
179                 grep -v "Richard Jones" \
180                 > AUTHORS-t
181         mv AUTHORS-t AUTHORS
182         cp AUTHORS $(distdir)/AUTHORS
183
184 # Update the list of translatable files in po/POTFILES.in.
185 all-local:
186         cd $(srcdir); \
187         find $(DIST_SUBDIRS) \
188             -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
189         grep -v '^perl/blib/' | \
190         grep -v '^capitests/' | \
191         grep -v '^daemon/lib/' | \
192         grep -v '^daemon/tests/' | \
193         grep -v '^examples/' | \
194         grep -v '^gnulib/' | \
195         grep -v '^perl/examples/' | \
196         grep -v '/guestfs_protocol.c' | \
197         grep -v '/rc_protocol.c' | \
198         grep -v 'appliance/debian/root' | \
199         grep -v '^po-docs/' | \
200         LC_ALL=C sort | \
201         sed 's,^\./,,' > po/POTFILES.in
202
203 # Pkgconfig.
204
205 pkgconfigdir = $(libdir)/pkgconfig
206 pkgconfig_DATA = libguestfs.pc
207
208 # Make clean.
209
210 CLEANFILES = $(fs_DATA) \
211         emptydisk \
212         pod2htm?.tmp \
213         html/*.html \
214         guestfs.3 guestfish.1
215
216 clean-local:
217         rm -rf initramfs
218
219 # If you don't want to run all of the tests ('make check') then this
220 # will just run libguestfs-test-tool for a quick check.  Note this
221 # is NOT a substitute for proper testing!
222
223 quickcheck:
224         test-tool/run-test-tool-locally
225
226 # Mostly static binary distribution.
227 #
228 # Some binaries are relinked partially statically.  You can make these
229 # binaries "more static" by making sure that as many foo-static
230 # packages are installed as possible.
231 #
232 # We remove the supermin appliance and adjust some directories to make
233 # them non-Fedora-specific.
234
235 BINTMPDIR = /tmp/libguestfs-bin
236 bindist:
237         rm -rf $(BINTMPDIR)
238         mkdir $(BINTMPDIR)
239         $(MAKE)
240         $(MAKE) DESTDIR=$(BINTMPDIR) install
241         rm -r $(BINTMPDIR)$(libdir)/guestfs/supermin.d
242         rm $(BINTMPDIR)$(libdir)/guestfs/kmod.whitelist
243         mv $(BINTMPDIR)$(prefix)/lib64/* $(BINTMPDIR)$(libdir)
244         mv $(BINTMPDIR)/usr/lib64/* $(BINTMPDIR)$(libdir)
245         -find $(BINTMPDIR) -type d -exec rmdir --ignore-fail-on-non-empty {} \;
246         $(MAKE) -C fish guestfish.static
247         cp fish/guestfish.static $(BINTMPDIR)$(bindir)/guestfish
248         $(MAKE) -C fuse guestmount.static
249         cp fuse/guestmount.static $(BINTMPDIR)$(bindir)/guestmount
250         $(MAKE) -C test-tool libguestfs-test-tool.static
251         cp test-tool/libguestfs-test-tool.static $(BINTMPDIR)$(bindir)/libguestfs-test-tool
252         $(MAKE) -C cat virt-cat.static
253         cp cat/virt-cat.static $(BINTMPDIR)$(bindir)/virt-cat
254         $(MAKE) -C inspector virt-inspector.static
255         cp inspector/virt-inspector.static $(BINTMPDIR)$(bindir)/virt-inspector
256         (cd $(BINTMPDIR) && tar cf - .) | \
257           gzip -c -9 > libguestfs-$(VERSION)-$(host_cpu).tar.gz