New commands: mkfs-b, mke2journal*, mke2fs-J*
[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 -I gnulib/m4
19
20 SUBDIRS = gnulib/lib src daemon appliance fish po examples images \
21         gnulib/tests capitests regressions test-tool
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 if HAVE_DF
48 SUBDIRS += df
49 endif
50 if HAVE_CAT
51 SUBDIRS += cat
52 endif
53
54 EXTRA_DIST = \
55         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
56         guestfish.pod guestfish-actions.pod \
57         html/pod.css \
58         HACKING TODO \
59         libguestfs.pc libguestfs.pc.in \
60         recipes/LICENSE \
61         recipes/README \
62         recipes/*.html \
63         recipes/*.sh \
64         recipes/*.example \
65         html/recipes.css \
66         make-recipes.sh \
67         contrib/README \
68         contrib/febootstrap/install.title \
69         contrib/febootstrap/install.html \
70         contrib/febootstrap/install.sh \
71         bindtests \
72         libguestfs.3
73
74 # Manual pages.
75 # guestfs-actions.pod and guestfs-structs are autogenerated.  There is
76 # no include mechanism for POD, so we have to do it by hand.
77
78 man_MANS = guestfs.3 libguestfs.3 guestfish.1
79
80 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
81         sed \
82           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
83           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
84           < $< | \
85         $(POD2MAN) \
86           --section 3 \
87           -c "Virtualization Support" \
88           --name "guestfs" \
89           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
90           > $@
91
92 guestfish.1: guestfish.pod guestfish-actions.pod
93         sed \
94           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
95           < $< | \
96         $(POD2MAN) \
97           --section 1 \
98           -c "Virtualization Support" \
99           --name "guestfish" \
100           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
101           > $@
102
103 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
104
105 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
106         mkdir -p html
107         sed \
108           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
109           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
110           < $< | \
111         pod2html \
112           --css 'pod.css' \
113           --title "libguestfs API documentation" \
114           --htmldir html \
115           --outfile $@
116
117 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
118         mkdir -p html
119         sed \
120           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
121           < $< | \
122         pod2html \
123           --css 'pod.css' \
124           --title "guestfish, libguestfs filesystem interactive shell" \
125           --htmldir html \
126           --outfile $@
127
128 # Recipes web page.
129 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
130         mkdir -p html
131         rm -f $@ $@-t
132         sh make-recipes.sh recipes/*.sh > $@-t
133         mv $@-t $@
134
135 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
136         html/virt-cat.1.html \
137         html/virt-df.1.html \
138         html/virt-inspector.1.html \
139         html/virt-v2v.1.html \
140         html/recipes.html \
141         html/pod.css html/recipes.css
142
143 TEXTFILES = README TODO HACKING
144
145 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
146
147 website: $(HTMLFILES) $(TEXTFILES)
148         cp $(HTMLFILES) $(WEBSITEDIR)
149         for f in $(TEXTFILES); do cp $$f $(WEBSITEDIR)/$$f.txt; done
150
151 # Generate the ChangeLog automatically from the gitlog.
152
153 dist-hook:
154         $(top_srcdir)/build-aux/gitlog-to-changelog > ChangeLog
155         cp ChangeLog $(distdir)/ChangeLog
156
157 # Update the list of translatable files in po/POTFILES.in.
158 all-local:
159         cd $(srcdir); \
160         find $(DIST_SUBDIRS) -name '*.c' -o -name '*.pl' -o -name '*.pm' | \
161         grep -v 'perl/blib/' | \
162         grep -v 'capitests/' | \
163         grep -v 'daemon/lib/' | \
164         grep -v 'daemon/tests/' | \
165         grep -v 'examples/' | \
166         grep -v '/guestfs_protocol.c' | \
167         grep -v '/rc_protocol.c' | \
168         LC_ALL=C sort | \
169         sed 's,^\./,,' > po/POTFILES.in
170
171 # Pkgconfig.
172
173 pkgconfigdir = $(libdir)/pkgconfig
174 pkgconfig_DATA = libguestfs.pc
175
176 # Make clean.
177
178 CLEANFILES = $(fs_DATA) \
179         emptydisk \
180         pod2htm?.tmp \
181         html/*.html \
182         guestfs.3 guestfish.1
183
184 clean-local:
185         rm -rf initramfs