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