Support for Windows Registry.
[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 = gnulib/lib hivex src daemon appliance fish po examples images \
21         gnulib/tests capitests regressions test-tool
22
23 # NB: Must build inspector directory after perl and before ocaml.
24 # We could relax this if we combined the inspector_generator with
25 # the ordinary generator, but that brings other problems.
26 if HAVE_PERL
27 SUBDIRS += perl
28 endif
29
30 if HAVE_INSPECTOR
31 SUBDIRS += inspector
32 endif
33 if HAVE_TOOLS
34 SUBDIRS += tools
35 endif
36
37 if HAVE_OCAML
38 SUBDIRS += ocaml ocaml/examples
39 endif
40 if HAVE_PYTHON
41 SUBDIRS += python
42 endif
43 if HAVE_RUBY
44 SUBDIRS += ruby
45 endif
46 if HAVE_JAVA
47 SUBDIRS += java
48 endif
49 if HAVE_HASKELL
50 SUBDIRS += haskell
51 endif
52
53 EXTRA_DIST = \
54         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
55         guestfish.pod guestfish-actions.pod \
56         html/pod.css \
57         HACKING TODO \
58         libguestfs.pc libguestfs.pc.in \
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         mkdir -p html
106         sed \
107           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
108           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
109           < $< | \
110         pod2html \
111           --css 'pod.css' \
112           --title "libguestfs API documentation" \
113           --htmldir html \
114           --outfile $@
115
116 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
117         mkdir -p html
118         sed \
119           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
120           < $< | \
121         pod2html \
122           --css 'pod.css' \
123           --title "guestfish, libguestfs filesystem interactive shell" \
124           --htmldir html \
125           --outfile $@
126
127 # Recipes web page.
128 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
129         mkdir -p html
130         rm -f $@ $@-t
131         sh make-recipes.sh recipes/*.sh > $@-t
132         mv $@-t $@
133
134 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
135         html/virt-cat.1.html \
136         html/virt-df.1.html \
137         html/virt-edit.1.html \
138         html/virt-inspector.1.html \
139         html/virt-ls.1.html \
140         html/virt-rescue.1.html \
141         html/virt-tar.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         cd $(WEBSITEDIR) && \
153         date=`date +%F`; \
154         sed -e "s/SUBST_VERSION/$(VERSION)/" \
155             -e "s/SUBST_DATE/$$date/" \
156         < index.html.in > index.html
157
158 # Generate the ChangeLog automatically from the gitlog.
159
160 dist-hook:
161         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
162         cp ChangeLog $(distdir)/ChangeLog
163
164 # Update the list of translatable files in po/POTFILES.in.
165 all-local:
166         cd $(srcdir); \
167         find $(DIST_SUBDIRS) \
168             -name '*.c' -o -name '*.pl' -o -name '*.pm' -o \
169             -name 'virt-cat' -o \
170             -name 'virt-df' -o \
171             -name 'virt-edit' -o \
172             -name 'virt-inspector' -o \
173             -name 'virt-ls' -o \
174             -name 'virt-rescue' -o \
175             -name 'virt-tar' | \
176         grep -v '^perl/blib/' | \
177         grep -v '^capitests/' | \
178         grep -v '^daemon/lib/' | \
179         grep -v '^daemon/tests/' | \
180         grep -v '^examples/' | \
181         grep -v '^gnulib/' | \
182         grep -v '^perl/examples/' | \
183         grep -v '/guestfs_protocol.c' | \
184         grep -v '/rc_protocol.c' | \
185         LC_ALL=C sort | \
186         sed 's,^\./,,' > po/POTFILES.in
187
188 # Pkgconfig.
189
190 pkgconfigdir = $(libdir)/pkgconfig
191 pkgconfig_DATA = libguestfs.pc
192
193 # Make clean.
194
195 CLEANFILES = $(fs_DATA) \
196         emptydisk \
197         pod2htm?.tmp \
198         html/*.html \
199         guestfs.3 guestfish.1
200
201 clean-local:
202         rm -rf initramfs