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