Rename virt-[tool].pl as virt-[tool]
[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 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_DF
45 SUBDIRS += df
46 endif
47 if HAVE_CAT
48 SUBDIRS += cat
49 endif
50 if HAVE_RESCUE
51 SUBDIRS += rescue
52 endif
53 if HAVE_EDIT
54 SUBDIRS += edit
55 endif
56
57 EXTRA_DIST = \
58         guestfs.pod guestfs-actions.pod guestfs-structs.pod \
59         guestfish.pod guestfish-actions.pod \
60         html/pod.css \
61         HACKING TODO \
62         libguestfs.pc libguestfs.pc.in \
63         recipes/LICENSE \
64         recipes/README \
65         recipes/*.html \
66         recipes/*.sh \
67         recipes/*.example \
68         html/recipes.css \
69         make-recipes.sh \
70         contrib/README \
71         contrib/febootstrap/install.title \
72         contrib/febootstrap/install.html \
73         contrib/febootstrap/install.sh \
74         bindtests \
75         libguestfs.3
76
77 # Manual pages.
78 # guestfs-actions.pod and guestfs-structs are autogenerated.  There is
79 # no include mechanism for POD, so we have to do it by hand.
80
81 man_MANS = guestfs.3 libguestfs.3 guestfish.1
82
83 guestfs.3: guestfs.pod guestfs-actions.pod guestfs-structs.pod
84         sed \
85           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
86           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
87           < $< | \
88         $(POD2MAN) \
89           --section 3 \
90           -c "Virtualization Support" \
91           --name "guestfs" \
92           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
93           > $@
94
95 guestfish.1: guestfish.pod guestfish-actions.pod
96         sed \
97           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
98           < $< | \
99         $(POD2MAN) \
100           --section 1 \
101           -c "Virtualization Support" \
102           --name "guestfish" \
103           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
104           > $@
105
106 noinst_DATA = html/guestfs.3.html html/guestfish.1.html
107
108 html/guestfs.3.html: guestfs.pod guestfs-actions.pod guestfs-structs.pod
109         mkdir -p html
110         sed \
111           -e '/@ACTIONS@/rguestfs-actions.pod' -e 's/@ACTIONS@//' \
112           -e '/@STRUCTS@/rguestfs-structs.pod' -e 's/@STRUCTS@//' \
113           < $< | \
114         pod2html \
115           --css 'pod.css' \
116           --title "libguestfs API documentation" \
117           --htmldir html \
118           --outfile $@
119
120 html/guestfish.1.html: guestfish.pod guestfish-actions.pod
121         mkdir -p html
122         sed \
123           -e '/@ACTIONS@/rguestfish-actions.pod' -e 's/@ACTIONS@//' \
124           < $< | \
125         pod2html \
126           --css 'pod.css' \
127           --title "guestfish, libguestfs filesystem interactive shell" \
128           --htmldir html \
129           --outfile $@
130
131 # Recipes web page.
132 html/recipes.html: $(wildcard recipes/*.sh) $(wildcard recipes/*.html) $(wildcard recipes/*.example) Makefile make-recipes.sh
133         mkdir -p html
134         rm -f $@ $@-t
135         sh make-recipes.sh recipes/*.sh > $@-t
136         mv $@-t $@
137
138 HTMLFILES = html/guestfs.3.html html/guestfish.1.html \
139         html/virt-cat.1.html \
140         html/virt-df.1.html \
141         html/virt-inspector.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-rescue' | \
174         grep -v '^perl/blib/' | \
175         grep -v '^capitests/' | \
176         grep -v '^daemon/lib/' | \
177         grep -v '^daemon/tests/' | \
178         grep -v '^examples/' | \
179         grep -v '^gnulib/' | \
180         grep -v '^perl/examples/' | \
181         grep -v '/guestfs_protocol.c' | \
182         grep -v '/rc_protocol.c' | \
183         LC_ALL=C sort | \
184         sed 's,^\./,,' > po/POTFILES.in
185
186 # Pkgconfig.
187
188 pkgconfigdir = $(libdir)/pkgconfig
189 pkgconfig_DATA = libguestfs.pc
190
191 # Make clean.
192
193 CLEANFILES = $(fs_DATA) \
194         emptydisk \
195         pod2htm?.tmp \
196         html/*.html \
197         guestfs.3 guestfish.1
198
199 clean-local:
200         rm -rf initramfs