Add 'add_drive_ro' call. Fix up documentation. Plus a couple of minor code improvemen...
[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 capitests
21
22 if HAVE_OCAML
23 SUBDIRS += ocaml
24 endif
25 if HAVE_PERL
26 SUBDIRS += perl
27 endif
28 if HAVE_PYTHON
29 SUBDIRS += python
30 endif
31 if HAVE_RUBY
32 SUBDIRS += ruby
33 endif
34 if HAVE_JAVA
35 SUBDIRS += java
36 endif
37 if HAVE_HASKELL
38 SUBDIRS += haskell
39 endif
40 if HAVE_INSPECTOR
41 SUBDIRS += inspector
42 endif
43
44 EXTRA_DIST = \
45         config.rpath \
46         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
47         guestfish.pod guestfish-actions.pod \
48         html/pod.css \
49         HACKING TODO \
50         libguestfs.pc libguestfs.pc.in \
51         gitlog-to-changelog \
52         recipes/LICENSE \
53         recipes/README \
54         recipes/*.html \
55         recipes/*.sh \
56         recipes/*.example \
57         html/recipes.css \
58         make-recipes.sh \
59         contrib/README \
60         contrib/febootstrap/install.title \
61         contrib/febootstrap/install.html \
62         contrib/febootstrap/install.sh \
63         bindtests
64
65 # Manual pages.
66 # guestfs-actions.pod and guestfs-structs are autogenerated.  There is
67 # no include mechanism for POD, so we have to do it by hand.
68
69 man_MANS = guestfs.3 guestfish.1
70
71 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
72         sed \
73           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
74           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
75           < $< | \
76         $(POD2MAN) \
77           --section 3 \
78           -c "Virtualization Support" \
79           --name "guestfs" \
80           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
81           > $@
82
83 guestfish.1: guestfish.pod guestfish-actions.pod
84         sed \
85           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
86           < $< | \
87         $(POD2MAN) \
88           --section 1 \
89           -c "Virtualization Support" \
90           --name "guestfish" \
91           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
92           > $@
93
94 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
95
96 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
97         sed \
98           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
99           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
100           < $< | \
101         pod2html \
102           --css 'pod.css' \
103           --title "libguestfs API documentation" \
104           --htmldir html \
105           --outfile $@
106
107 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
108         sed \
109           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
110           < $< | \
111         pod2html \
112           --css 'pod.css' \
113           --title "guestfish, libguestfs filesystem interactive shell" \
114           --htmldir html \
115           --outfile $@
116
117 # Recipes web page.
118 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
119         rm -f $@ $@-t
120         sh make-recipes.sh recipes/*.sh > $@-t
121         mv $@-t $@
122
123 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
124         html/virt-inspector.1.html \
125         html/recipes.html \
126         html/pod.css html/recipes.css
127
128 TEXTFILES = README TODO HACKING
129
130 WEBSITEDIR = $(HOME)/d/redhat/et-website/libguestfs
131
132 website: $(HTMLFILES) $(TEXTFILES)
133         cp $(HTMLFILES) $(WEBSITEDIR)
134         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
135
136 # Generate the ChangeLog automatically from the gitlog.
137
138 dist-hook:
139         ./gitlog-to-changelog > ChangeLog
140         cp ChangeLog $(distdir)/ChangeLog
141
142 # Pkgconfig.
143
144 pkgconfigdir = $(libdir)/pkgconfig
145 pkgconfig_DATA = libguestfs.pc
146
147 # Make clean.
148
149 CLEANFILES = $(fs_DATA) emptydisk pod2htm?.tmp
150
151 clean-local:
152         rm -rf initramfs