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