3f276930f97b6e87e7995b29f32ac05a8a5404b6
[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
51 EXTRA_DIST = \
52         config.rpath \
53         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
54         guestfish.pod guestfish-actions.pod \
55         html/pod.css \
56         HACKING TODO \
57         libguestfs.pc libguestfs.pc.in \
58         gitlog-to-changelog \
59         recipes/LICENSE \
60         recipes/README \
61         recipes/*.html \
62         recipes/*.sh \
63         recipes/*.example \
64         html/recipes.css \
65         make-recipes.sh \
66         contrib/README \
67         contrib/febootstrap/install.title \
68         contrib/febootstrap/install.html \
69         contrib/febootstrap/install.sh \
70         bindtests \
71         libguestfs.3
72
73 # Manual pages.
74 # guestfs-actions.pod and guestfs-structs are autogenerated.  There is
75 # no include mechanism for POD, so we have to do it by hand.
76
77 man_MANS = guestfs.3 libguestfs.3 guestfish.1
78
79 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
80         sed \
81           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
82           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
83           < $< | \
84         $(POD2MAN) \
85           --section 3 \
86           -c "Virtualization Support" \
87           --name "guestfs" \
88           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
89           > $@
90
91 guestfish.1: guestfish.pod guestfish-actions.pod
92         sed \
93           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
94           < $< | \
95         $(POD2MAN) \
96           --section 1 \
97           -c "Virtualization Support" \
98           --name "guestfish" \
99           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
100           > $@
101
102 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
103
104 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
105         sed \
106           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
107           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
108           < $< | \
109         pod2html \
110           --css 'pod.css' \
111           --title "libguestfs API documentation" \
112           --htmldir html \
113           --outfile $@
114
115 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
116         sed \
117           -e '/@ACTIONS@/rguestfish-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         rm -f $@ $@-t
128         sh make-recipes.sh recipes/*.sh > $@-t
129         mv $@-t $@
130
131 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
132         html/virt-df.1.html \
133         html/virt-inspector.1.html \
134         html/virt-v2v.1.html \
135         html/recipes.html \
136         html/pod.css html/recipes.css
137
138 TEXTFILES = README TODO HACKING
139
140 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
141
142 website: $(HTMLFILES) $(TEXTFILES)
143         cp $(HTMLFILES) $(WEBSITEDIR)
144         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
145
146 # Generate the ChangeLog automatically from the gitlog.
147
148 dist-hook:
149         ./gitlog-to-changelog > ChangeLog
150         cp ChangeLog $(distdir)/ChangeLog
151
152 # Update the list of translatable files in po/POTFILES.in.
153 all-local:
154         find -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
155         grep -v '/blib/' | \
156         grep -v '/capitests/' | \
157         grep -v '/examples/' | \
158         sort | \
159         sed 's,^\./,,' > $(srcdir)/po/POTFILES.in
160
161 # Pkgconfig.
162
163 pkgconfigdir = $(libdir)/pkgconfig
164 pkgconfig_DATA = libguestfs.pc
165
166 # Make clean.
167
168 CLEANFILES = $(fs_DATA) emptydisk pod2htm?.tmp
169
170 clean-local:
171         rm -rf initramfs