Update PO files.
[libguestfs.git] / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009 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 SUBDIRS = gnulib/lib hivex src daemon appliance fish po examples images \
23         gnulib/tests capitests regressions test-tool
24
25 # NB: Must build inspector directory after perl and before ocaml.
26 # We could relax this if we combined the inspector_generator with
27 # the ordinary generator, but that brings other problems.
28 if HAVE_PERL
29 SUBDIRS += perl
30 endif
31
32 if HAVE_INSPECTOR
33 SUBDIRS += inspector
34 endif
35 if HAVE_TOOLS
36 SUBDIRS += tools
37 endif
38
39 if HAVE_FUSE
40 SUBDIRS += fuse
41 endif
42
43 if HAVE_OCAML
44 SUBDIRS += ocaml ocaml/examples
45 endif
46 if HAVE_PYTHON
47 SUBDIRS += python
48 endif
49 if HAVE_RUBY
50 SUBDIRS += ruby
51 endif
52 if HAVE_JAVA
53 SUBDIRS += java
54 endif
55 if HAVE_HASKELL
56 SUBDIRS += haskell
57 endif
58
59 generator_built = \
60         guestfs-actions.pod \
61         guestfs-availability.pod \
62         guestfs-structs.pod \
63         guestfish-actions.pod
64
65 EXTRA_DIST = \
66         $(generator_built) \
67         guestfs.pod \
68         guestfish.pod \
69         html/pod.css \
70         HACKING TODO \
71         libguestfs.pc libguestfs.pc.in \
72         recipes/LICENSE \
73         recipes/README \
74         recipes/*.html \
75         recipes/*.sh \
76         recipes/*.example \
77         html/recipes.css \
78         make-recipes.sh \
79         contrib/README \
80         bindtests \
81         libguestfs.3
82
83 # Manual pages.
84 # guestfs-actions.pod, guestfs-availability.pod and guestfs-structs
85 # are autogenerated.  There is no include mechanism for POD, so we
86 # have to do it by hand.
87
88 man_MANS = guestfs.3 libguestfs.3 guestfish.1
89
90 guestfs.3: guestfs.pod \
91                 guestfs-actions.pod \
92                 guestfs-availability.pod \
93                 guestfs-structs.pod
94         sed \
95           -e '/@ACTIONS@/rguestfs-actions.pod' \
96           -e 's/@ACTIONS@//' \
97           -e '/@AVAILABILITY@/rguestfs-availability.pod' \
98           -e 's/@AVAILABILITY@//' \
99           -e '/@STRUCTS@/rguestfs-structs.pod' \
100           -e 's/@STRUCTS@//' \
101           < $< | \
102         $(POD2MAN) \
103           --section 3 \
104           -c "Virtualization Support" \
105           --name "guestfs" \
106           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
107           > $@
108
109 guestfish.1: guestfish.pod guestfish-actions.pod
110         sed \
111           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
112           < $< | \
113         $(POD2MAN) \
114           --section 1 \
115           -c "Virtualization Support" \
116           --name "guestfish" \
117           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
118           > $@
119
120 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
121
122 html/guestfs.3.html: guestfs.pod \
123                 guestfs-actions.pod \
124                 guestfs-availability.pod \
125                 guestfs-structs.pod
126         mkdir -p html
127         sed \
128           -e '/@ACTIONS@/rguestfs-actions.pod' \
129           -e 's/@ACTIONS@//' \
130           -e '/@AVAILABILITY@/rguestfs-availability.pod' \
131           -e 's/@AVAILABILITY@//' \
132           -e '/@STRUCTS@/rguestfs-structs.pod' \
133           -e 's/@STRUCTS@//' \
134           < $< | \
135         pod2html \
136           --css 'pod.css' \
137           --title "libguestfs API documentation" \
138           --htmldir html \
139           --outfile $@
140
141 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
142         mkdir -p html
143         sed \
144           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
145           < $< | \
146         pod2html \
147           --css 'pod.css' \
148           --title "guestfish, libguestfs filesystem interactive shell" \
149           --htmldir html \
150           --outfile $@
151
152 # Recipes web page.
153 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
154         mkdir -p html
155         rm -f $@ $@-t
156         sh make-recipes.sh recipes/*.sh > $@-t
157         mv $@-t $@
158
159 HTMLFILES = \
160         html/guestfs.3.html \
161         html/guestfish.1.html \
162         html/guestmount.1.html \
163         html/hivex.3.html \
164         html/hivexget.1.html \
165         html/hivexml.1.html \
166         html/virt-cat.1.html \
167         html/virt-df.1.html \
168         html/virt-edit.1.html \
169         html/virt-inspector.1.html \
170         html/virt-list-filesystems.1.html \
171         html/virt-ls.1.html \
172         html/virt-rescue.1.html \
173         html/virt-tar.1.html \
174         html/virt-win-reg.1.html \
175         html/recipes.html \
176         html/pod.css html/recipes.css
177
178 TEXTFILES = README TODO HACKING
179
180 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
181
182 website: $(HTMLFILES) $(TEXTFILES)
183         cp $(HTMLFILES) $(WEBSITEDIR)
184         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
185         cd $(WEBSITEDIR) && \
186         date=`date +%F`; \
187         sed -e "s/SUBST_VERSION/$(VERSION)/" \
188             -e "s/SUBST_DATE/$$date/" \
189         < index.html.in > index.html
190
191 # Generate the ChangeLog automatically from the gitlog.
192
193 dist-hook:
194         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
195         cp ChangeLog $(distdir)/ChangeLog
196
197 # Update the list of translatable files in po/POTFILES.in.
198 all-local:
199         cd $(srcdir); \
200         find $(DIST_SUBDIRS) \
201             -name '*.c' -o -name '*.pl' -o -name '*.pm' -o \
202             -name 'virt-cat' -o \
203             -name 'virt-df' -o \
204             -name 'virt-edit' -o \
205             -name 'virt-inspector' -o \
206             -name 'virt-list-filesystems' -o \
207             -name 'virt-ls' -o \
208             -name 'virt-rescue' -o \
209             -name 'virt-tar' -o \
210             -name 'virt-win-reg' | \
211         grep -v '^perl/blib/' | \
212         grep -v '^capitests/' | \
213         grep -v '^daemon/lib/' | \
214         grep -v '^daemon/tests/' | \
215         grep -v '^examples/' | \
216         grep -v '^gnulib/' | \
217         grep -v '^perl/examples/' | \
218         grep -v '/guestfs_protocol.c' | \
219         grep -v '/rc_protocol.c' | \
220         grep -v 'appliance/debian/root' | \
221         LC_ALL=C sort | \
222         sed 's,^\./,,' > po/POTFILES.in
223
224 # Pkgconfig.
225
226 pkgconfigdir = $(libdir)/pkgconfig
227 pkgconfig_DATA = libguestfs.pc
228
229 # Make clean.
230
231 CLEANFILES = $(fs_DATA) \
232         emptydisk \
233         pod2htm?.tmp \
234         html/*.html \
235         guestfs.3 guestfish.1
236
237 clean-local:
238         rm -rf initramfs