Add config.mli to describe Config module.
[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 = HACKING Throbber.png Throbber.gif
21
22 CLEANFILES = *.cmi *.cmo *.cmx *.o guestfs-browser
23
24 SOURCES = \
25         cmdline.mli \
26         cmdline.ml \
27         config.mli \
28         config.ml \
29         filetree.mli \
30         filetree.ml \
31         main.ml \
32         slave.mli \
33         slave.ml \
34         throbber.ml \
35         utils.mli \
36         utils.ml \
37         window.mli \
38         window.ml
39
40 OBJECTS = \
41         throbber.cmx \
42         config.cmx \
43         utils.cmx \
44         slave.cmx \
45         filetree.cmx \
46         cmdline.cmx \
47         window.cmx \
48         main.cmx
49
50 bin_SCRIPTS = guestfs-browser
51
52 OCAMLPACKAGES = libvirt,guestfs,lablgtk2,extlib,xml-light,threads
53 OCAMLCFLAGS = \
54         -g \
55         -warn-error A \
56         -thread \
57         -package $(OCAMLPACKAGES) \
58         -predicates threads
59 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
60 OCAMLDOCFLAGS = \
61         -package $(OCAMLPACKAGES) \
62         -predicates threads \
63         -I +threads \
64         -sort -html
65
66 guestfs-browser: $(OBJECTS)
67         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
68           -predicates init,threads \
69           -linkpkg gtkThread.cmx \
70           $^ -o $@
71
72 # This file is built.  However gdk_pixbuf_mlsource requires X11 to
73 # run, which prevents this from being built in places where an X
74 # display is not available, such as on automated builders.  So we'll
75 # bundle this file in with the tarball anyway.
76 throbber.ml: Throbber.png Throbber.gif
77         $(GDK_PIXBUF_MLSOURCE) --build-list \
78           static Throbber.png \
79           animation Throbber.gif \
80           > $@-t && mv $@-t $@
81
82 .mli.cmi:
83         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
84 .ml.cmo:
85         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
86 .ml.cmx:
87         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
88
89 # Convert internal documentation to HTML.
90 docs:
91         rm -rf doc
92         mkdir -p doc
93         $(OCAMLFIND) ocamldoc -d doc $(OCAMLDOCFLAGS) $(SOURCES)
94
95 # Dependencies.
96 depend: .depend
97
98 .depend: $(wildcard *.mli) $(wildcard *.ml)
99         rm -f $@ $@-t
100         $(OCAMLFIND) ocamldep $^ > $@-t
101         mv $@-t $@
102
103 include .depend
104
105 .PHONY: depend docs