1f6f62e353ec6157c860f68ee9ceee1f0fcbf8a6
[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 ACLOCAL_AMFLAGS = -I m4
19
20 SUBDIRS = src daemon appliance fish po examples images \
21         capitests regressions
22
23 if HAVE_OCAML
24 SUBDIRS += ocaml
25 endif
26 if HAVE_PERL
27 SUBDIRS += perl
28 endif
29 if HAVE_PYTHON
30 SUBDIRS += python
31 endif
32 if HAVE_RUBY
33 SUBDIRS += ruby
34 endif
35 if HAVE_JAVA
36 SUBDIRS += java
37 endif
38 if HAVE_HASKELL
39 SUBDIRS += haskell
40 endif
41 if HAVE_INSPECTOR
42 SUBDIRS += inspector
43 endif
44 if HAVE_V2V
45 SUBDIRS += v2v
46 endif
47 if HAVE_DF
48 SUBDIRS += df
49 endif
50 if HAVE_CAT
51 SUBDIRS += cat
52 endif
53
54 EXTRA_DIST = \
55         config.rpath \
56         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
57         guestfish.pod guestfish-actions.pod \
58         html/pod.css \
59         HACKING TODO \
60         libguestfs.pc libguestfs.pc.in \
61         gitlog-to-changelog \
62         recipes/LICENSE \
63         recipes/README \
64         recipes/*.html \
65         recipes/*.sh \
66         recipes/*.example \
67         html/recipes.css \
68         make-recipes.sh \
69         contrib/README \
70         contrib/febootstrap/install.title \
71         contrib/febootstrap/install.html \
72         contrib/febootstrap/install.sh \
73         bindtests \
74         libguestfs.3
75
76 # Manual pages.
77 # guestfs-actions.pod and guestfs-structs are autogenerated.  There is
78 # no include mechanism for POD, so we have to do it by hand.
79
80 man_MANS = guestfs.3 libguestfs.3 guestfish.1
81
82 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
83         sed \
84           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
85           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
86           < $< | \
87         $(POD2MAN) \
88           --section 3 \
89           -c "Virtualization Support" \
90           --name "guestfs" \
91           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
92           > $@
93
94 guestfish.1: guestfish.pod guestfish-actions.pod
95         sed \
96           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
97           < $< | \
98         $(POD2MAN) \
99           --section 1 \
100           -c "Virtualization Support" \
101           --name "guestfish" \
102           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
103           > $@
104
105 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
106
107 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
108         mkdir -p html
109         sed \
110           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
111           -e '/@STRUCTS@/rguestfs-structs.pod' -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: guestfish.pod guestfish-actions.pod
120         mkdir -p html
121         sed \
122           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
123           < $< | \
124         pod2html \
125           --css 'pod.css' \
126           --title "guestfish, libguestfs filesystem interactive shell" \
127           --htmldir html \
128           --outfile $@
129
130 # Recipes web page.
131 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
132         mkdir -p html
133         rm -f $@ $@-t
134         sh make-recipes.sh recipes/*.sh > $@-t
135         mv $@-t $@
136
137 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
138         html/virt-cat.1.html \
139         html/virt-df.1.html \
140         html/virt-inspector.1.html \
141         html/virt-v2v.1.html \
142         html/recipes.html \
143         html/pod.css html/recipes.css
144
145 TEXTFILES = README TODO HACKING
146
147 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
148
149 website: $(HTMLFILES) $(TEXTFILES)
150         cp $(HTMLFILES) $(WEBSITEDIR)
151         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
152
153 # Generate the ChangeLog automatically from the gitlog.
154
155 dist-hook:
156         ./gitlog-to-changelog > ChangeLog
157         cp ChangeLog $(distdir)/ChangeLog
158
159 # Update the list of translatable files in po/POTFILES.in.
160 all-local:
161         cd $(srcdir); \
162         find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
163         grep -v 'perl/blib/' | \
164         grep -v 'capitests/' | \
165         grep -v 'examples/' | \
166         grep -v '/guestfs_protocol.c' | \
167         grep -v '/rc_protocol.c' | \
168         sort | \
169         sed 's,^\./,,' > po/POTFILES.in
170
171 # Pkgconfig.
172
173 pkgconfigdir = $(libdir)/pkgconfig
174 pkgconfig_DATA = libguestfs.pc
175
176 # Make clean.
177
178 CLEANFILES = $(fs_DATA) \
179         emptydisk \
180         pod2htm?.tmp \
181         html/*.html \
182         guestfs.3 guestfish.1
183
184 clean-local:
185         rm -rf initramfs