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