Version 1.3.1.
[libguestfs.git] / Makefile.am
1 # libguestfs
2 # Copyright (C) 2009-2010 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 src
23
24 if ENABLE_DAEMON
25 SUBDIRS += daemon
26 endif
27 if ENABLE_APPLIANCE
28 SUBDIRS += appliance
29 endif
30
31 SUBDIRS += fish po examples images
32 SUBDIRS += gnulib/tests capitests regressions test-tool
33
34 if HAVE_PERL
35 SUBDIRS += perl
36 endif
37
38 if HAVE_INSPECTOR
39 SUBDIRS += inspector
40 endif
41 if HAVE_TOOLS
42 SUBDIRS += tools
43 endif
44
45 if HAVE_FUSE
46 SUBDIRS += fuse
47 endif
48
49 if HAVE_OCAML
50 SUBDIRS += ocaml ocaml/examples
51 endif
52 if HAVE_PYTHON
53 SUBDIRS += python
54 endif
55 if HAVE_RUBY
56 SUBDIRS += ruby
57 endif
58 if HAVE_JAVA
59 SUBDIRS += java
60 endif
61 if HAVE_HASKELL
62 SUBDIRS += haskell
63 endif
64
65 EXTRA_DIST = \
66         $(generator_built) \
67         html/pod.css \
68         HACKING TODO \
69         libguestfs.pc libguestfs.pc.in \
70         recipes/LICENSE \
71         recipes/README \
72         recipes/*.html \
73         recipes/*.sh \
74         recipes/*.example \
75         html/recipes.css \
76         make-recipes.sh \
77         contrib/README \
78         bindtests \
79         .gitignore \
80         m4/.gitignore
81
82 # HTML versions of manual pages.
83
84 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
85
86 html/guestfs.3.html: src/guestfs.pod \
87                 src/guestfs-actions.pod \
88                 src/guestfs-availability.pod \
89                 src/guestfs-structs.pod
90         mkdir -p html
91         sed \
92           -e '/@ACTIONS@/rsrc/guestfs-actions.pod' \
93           -e 's/@ACTIONS@//' \
94           -e '/@AVAILABILITY@/rsrc/guestfs-availability.pod' \
95           -e 's/@AVAILABILITY@//' \
96           -e '/@STRUCTS@/rsrc/guestfs-structs.pod' \
97           -e 's/@STRUCTS@//' \
98           < $< | \
99         pod2html \
100           --css 'pod.css' \
101           --title "libguestfs API documentation" \
102           --htmldir html \
103           --outfile $@
104
105 html/guestfish.1.html: fish/guestfish.pod fish/guestfish-actions.pod
106         mkdir -p html
107         sed \
108           -e '/@ACTIONS@/rfish/guestfish-actions.pod' -e 's/@ACTIONS@//' \
109           < $< | \
110         pod2html \
111           --css 'pod.css' \
112           --title "guestfish, libguestfs filesystem interactive shell" \
113           --htmldir html \
114           --outfile $@
115
116 # Recipes web page.
117 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
118         mkdir -p html
119         rm -f $@ $@-t
120         sh make-recipes.sh recipes/*.sh > $@-t
121         mv $@-t $@
122
123 HTMLFILES = \
124         html/guestfs.3.html \
125         html/guestfish.1.html \
126         html/guestmount.1.html \
127         html/virt-cat.1.html \
128         html/virt-df.1.html \
129         html/virt-edit.1.html \
130         html/virt-inspector.1.html \
131         html/virt-list-filesystems.1.html \
132         html/virt-list-partitions.1.html \
133         html/virt-ls.1.html \
134         html/virt-make-fs.1.html \
135         html/virt-rescue.1.html \
136         html/virt-resize.1.html \
137         html/virt-tar.1.html \
138         html/virt-win-reg.1.html \
139         html/recipes.html \
140         html/pod.css html/recipes.css
141
142 TEXTFILES = README TODO HACKING
143
144 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
145
146 website: $(HTMLFILES) $(TEXTFILES)
147         cp $(HTMLFILES) $(WEBSITEDIR)
148         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
149         cd $(WEBSITEDIR) && \
150         date=`date +%F`; \
151         sed -e "s/SUBST_VERSION/$(VERSION)/" \
152             -e "s/SUBST_DATE/$$date/" \
153         < index.html.in > index.html
154
155 # Generate the ChangeLog automatically from the gitlog.
156
157 dist-hook:
158         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
159         cp ChangeLog $(distdir)/ChangeLog
160
161 # Update the list of translatable files in po/POTFILES.in.
162 all-local:
163         cd $(srcdir); \
164         find $(DIST_SUBDIRS) \
165             -name '*.c' -o -name '*.pl' -o -name '*.pm' -o \
166             -name 'virt-cat' -o \
167             -name 'virt-df' -o \
168             -name 'virt-edit' -o \
169             -name 'virt-inspector' -o \
170             -name 'virt-list-filesystems' -o \
171             -name 'virt-list-partitions' -o \
172             -name 'virt-ls' -o \
173             -name 'virt-make-fs' -o \
174             -name 'virt-rescue' -o \
175             -name 'virt-resize' -o \
176             -name 'virt-tar' -o \
177             -name 'virt-win-reg' | \
178         grep -v '^perl/blib/' | \
179         grep -v '^capitests/' | \
180         grep -v '^daemon/lib/' | \
181         grep -v '^daemon/tests/' | \
182         grep -v '^examples/' | \
183         grep -v '^gnulib/' | \
184         grep -v '^perl/examples/' | \
185         grep -v '/guestfs_protocol.c' | \
186         grep -v '/rc_protocol.c' | \
187         grep -v 'appliance/debian/root' | \
188         LC_ALL=C sort | \
189         sed 's,^\./,,' > po/POTFILES.in
190
191 # Pkgconfig.
192
193 pkgconfigdir = $(libdir)/pkgconfig
194 pkgconfig_DATA = libguestfs.pc
195
196 # Make clean.
197
198 CLEANFILES = $(fs_DATA) \
199         emptydisk \
200         pod2htm?.tmp \
201         html/*.html \
202         guestfs.3 guestfish.1
203
204 clean-local:
205         rm -rf initramfs
206
207 # If you don't want to run all of the tests ('make check') then this
208 # will just run libguestfs-test-tool for a quick check.  Note this
209 # is NOT a substitute for proper testing!
210
211 quickcheck:
212         LIBGUESTFS_PATH=appliance \
213         test-tool/libguestfs-test-tool \
214           --helper test-tool/libguestfs-test-tool-helper