hivex: Move header checksum code into a function.
[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 include $(top_srcdir)/subdir-rules.mk
19
20 ACLOCAL_AMFLAGS = -I m4
21
22 SUBDIRS = gnulib/lib hivex src daemon appliance fish po examples images \
23         gnulib/tests capitests regressions test-tool
24
25 # NB: Must build inspector directory after perl and before ocaml.
26 # We could relax this if we combined the inspector_generator with
27 # the ordinary generator, but that brings other problems.
28 if HAVE_PERL
29 SUBDIRS += perl
30 endif
31
32 if HAVE_INSPECTOR
33 SUBDIRS += inspector
34 endif
35 if HAVE_TOOLS
36 SUBDIRS += tools
37 endif
38
39 if HAVE_FUSE
40 SUBDIRS += fuse
41 endif
42
43 if HAVE_OCAML
44 SUBDIRS += ocaml ocaml/examples
45 endif
46 if HAVE_PYTHON
47 SUBDIRS += python
48 endif
49 if HAVE_RUBY
50 SUBDIRS += ruby
51 endif
52 if HAVE_JAVA
53 SUBDIRS += java
54 endif
55 if HAVE_HASKELL
56 SUBDIRS += haskell
57 endif
58
59 EXTRA_DIST = \
60         $(generator_built) \
61         html/pod.css \
62         HACKING TODO \
63         libguestfs.pc libguestfs.pc.in \
64         recipes/LICENSE \
65         recipes/README \
66         recipes/*.html \
67         recipes/*.sh \
68         recipes/*.example \
69         html/recipes.css \
70         make-recipes.sh \
71         contrib/README \
72         bindtests
73
74 # HTML versions of manual pages.
75
76 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
77
78 html/guestfs.3.html: src/guestfs.pod \
79                 src/guestfs-actions.pod \
80                 src/guestfs-availability.pod \
81                 src/guestfs-structs.pod
82         mkdir -p html
83         sed \
84           -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
85           -e 's/@ACTIONS@//' \
86           -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
87           -e 's/@AVAILABILITY@//' \
88           -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
89           -e 's/@STRUCTS@//' \
90           < $< | \
91         pod2html \
92           --css 'pod.css' \
93           --title "libguestfs API documentation" \
94           --htmldir html \
95           --outfile $@
96
97 html/guestfish.1.html: fish/guestfish.pod fish/guestfish-actions.pod
98         mkdir -p html
99         sed \
100           -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
101           < $< | \
102         pod2html \
103           --css 'pod.css' \
104           --title "guestfish, libguestfs filesystem interactive shell" \
105           --htmldir html \
106           --outfile $@
107
108 # Recipes web page.
109 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
110         mkdir -p html
111         rm -f $@ $@-t
112         sh make-recipes.sh recipes/*.sh > $@-t
113         mv $@-t $@
114
115 HTMLFILES = \
116         html/guestfs.3.html \
117         html/guestfish.1.html \
118         html/guestmount.1.html \
119         html/hivex.3.html \
120         html/hivexget.1.html \
121         html/hivexml.1.html \
122         html/virt-cat.1.html \
123         html/virt-df.1.html \
124         html/virt-edit.1.html \
125         html/virt-inspector.1.html \
126         html/virt-list-filesystems.1.html \
127         html/virt-ls.1.html \
128         html/virt-rescue.1.html \
129         html/virt-tar.1.html \
130         html/virt-win-reg.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         cd $(WEBSITEDIR) && \
142         date=`date +%F`; \
143         sed -e "s/SUBST_VERSION/$(VERSION)/" \
144             -e "s/SUBST_DATE/$$date/" \
145         < index.html.in > index.html
146
147 # Generate the ChangeLog automatically from the gitlog.
148
149 dist-hook:
150         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
151         cp ChangeLog $(distdir)/ChangeLog
152
153 # Update the list of translatable files in po/POTFILES.in.
154 all-local:
155         cd $(srcdir); \
156         find $(DIST_SUBDIRS) \
157             -name '*.c' -o -name '*.pl' -o -name '*.pm' -o \
158             -name 'virt-cat' -o \
159             -name 'virt-df' -o \
160             -name 'virt-edit' -o \
161             -name 'virt-inspector' -o \
162             -name 'virt-list-filesystems' -o \
163             -name 'virt-ls' -o \
164             -name 'virt-rescue' -o \
165             -name 'virt-tar' -o \
166             -name 'virt-win-reg' | \
167         grep -v '^perl/blib/' | \
168         grep -v '^capitests/' | \
169         grep -v '^daemon/lib/' | \
170         grep -v '^daemon/tests/' | \
171         grep -v '^examples/' | \
172         grep -v '^gnulib/' | \
173         grep -v '^perl/examples/' | \
174         grep -v '/guestfs_protocol.c' | \
175         grep -v '/rc_protocol.c' | \
176         grep -v 'appliance/debian/root' | \
177         LC_ALL=C sort | \
178         sed 's,^\./,,' > po/POTFILES.in
179
180 # Pkgconfig.
181
182 pkgconfigdir = $(libdir)/pkgconfig
183 pkgconfig_DATA = libguestfs.pc
184
185 # Make clean.
186
187 CLEANFILES = $(fs_DATA) \
188         emptydisk \
189         pod2htm?.tmp \
190         html/*.html \
191         guestfs.3 guestfish.1
192
193 clean-local:
194         rm -rf initramfs