Switch to using new event API.
[guestfs-browser.git] / Makefile.am
1 # Guestfs Browser.
2 # Copyright (C) 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 along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17
18 ACLOCAL_AMFLAGS = -I m4
19
20 EXTRA_DIST = \
21         $(SOURCES) \
22         HACKING \
23         Throbber.png Throbber.gif \
24         .gitignore guestfs-browser.spec \
25         guestfs-browser.pod \
26         guestfs-browser.1 \
27         html/pod.css
28
29 CLEANFILES = *.cmi *.cmo *.cmx *.cmxa *.o guestfs-browser *~
30
31 # These are listed here in alphabetical order.
32 SOURCES = \
33         cmdline.mli \
34         cmdline.ml \
35         config.mli \
36         config.ml \
37         deviceSet.mli \
38         deviceSet.ml \
39         filetree.mli \
40         filetree.ml \
41         filetree_markup.mli \
42         filetree_markup.ml \
43         filetree_ops.mli \
44         filetree_ops.ml \
45         filetree_type.mli \
46         filetree_type.ml \
47         main.ml \
48         slave.mli \
49         slave.ml \
50         slave_types.mli \
51         slave_types.ml \
52         slave_utils.mli \
53         slave_utils.ml \
54         throbber.ml \
55         utils.mli \
56         utils.ml \
57         window.mli \
58         window.ml
59
60 # Note this list must be in dependency order.
61 OBJECTS = \
62         config.cmx \
63         throbber.cmx \
64         utils.cmx \
65         cmdline.cmx \
66         deviceSet.cmx \
67         slave_types.cmx \
68         slave_utils.cmx \
69         slave.cmx \
70         filetree_type.cmx \
71         filetree_markup.cmx \
72         filetree_ops.cmx \
73         filetree.cmx \
74         window.cmx \
75         main.cmx
76
77 bin_SCRIPTS = guestfs-browser
78
79 OCAMLPACKAGES = \
80         -package libvirt,guestfs,hivex,lablgtk2,extlib,xml-light,camomile,threads,bitstring,bitstring.syntax -syntax bitstring
81 OCAMLCFLAGS = \
82         -g \
83         -warn-error CDEFLMPSUVYZX \
84         -thread \
85         $(OCAMLPACKAGES) \
86         -predicates threads
87 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
88 OCAMLDOCFLAGS = \
89         $(OCAMLPACKAGES) \
90         -predicates threads \
91         -I +threads \
92         -sort -html
93
94 guestfs-browser: $(OBJECTS)
95         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
96           -predicates init,threads \
97           -linkpkg gtkThread.cmx \
98           $^ -o $@
99
100 # This file is built.  However gdk_pixbuf_mlsource requires X11 to
101 # run, which prevents this from being built in places where an X
102 # display is not available, such as on automated builders.  So we'll
103 # bundle this file in with the tarball anyway.
104 throbber.ml: Throbber.png Throbber.gif
105         $(GDK_PIXBUF_MLSOURCE) --build-list \
106           static Throbber.png \
107           animation Throbber.gif \
108           > $@-t && mv $@-t $@
109
110 .mli.cmi:
111         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
112 .ml.cmo:
113         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
114 .ml.cmx:
115         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
116
117 # Man page.
118 man_MANS = guestfs-browser.1
119
120 if HAVE_PERLDOC
121
122 guestfs-browser.1: guestfs-browser.pod
123         pod2man \
124           --section 1 \
125           -c "Virtualization Support" \
126           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
127           $< > $@
128
129 noinst_DATA = \
130         html/guestfs-browser.1.html
131
132 html/guestfs-browser.1.html: guestfs-browser.pod
133         mkdir -p html
134         pod2html \
135           --css 'pod.css' \
136           --htmldir html \
137           --outfile html/guestfs-browser.1.html \
138           guestfs-browser.pod
139
140 endif
141
142 # Maintainer website update.
143 HTMLFILES = \
144         html/guestfs-browser.1.html
145
146 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
147
148 website: $(HTMLFILES)
149         cp $(HTMLFILES) $(WEBSITEDIR)
150
151 CLEANFILES += $(HTMLFILES) pod2*.tmp
152
153 # Convert internal documentation to HTML.
154 docs:
155         rm -rf doc
156         mkdir -p doc
157         $(OCAMLFIND) ocamldoc -d doc $(OCAMLDOCFLAGS) $(SOURCES)
158
159 # Dependencies.
160 depend: .depend
161
162 .depend: $(wildcard *.mli) $(wildcard *.ml)
163         rm -f $@ $@-t
164         $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) $^ | \
165           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
166           sort > $@-t
167         mv $@-t $@
168
169 include .depend
170
171 .PHONY: depend docs