Version 0.0.1
[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.ml \
28         filetree.mli \
29         filetree.ml \
30         main.ml \
31         slave.mli \
32         slave.ml \
33         throbber.ml \
34         utils.mli \
35         utils.ml \
36         window.mli \
37         window.ml
38
39 OBJECTS = \
40         throbber.cmx \
41         config.cmx \
42         utils.cmx \
43         slave.cmx \
44         filetree.cmx \
45         cmdline.cmx \
46         window.cmx \
47         main.cmx
48
49 bin_SCRIPTS = guestfs-browser
50
51 OCAMLCFLAGS = \
52         -g \
53         -warn-error A \
54         -thread \
55         -package libvirt,guestfs,lablgtk2,extlib,xml-light,threads
56
57 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
58
59 guestfs-browser: $(OBJECTS)
60         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
61           -predicates init,threads \
62           -linkpkg gtkThread.cmx \
63           $^ -o $@
64
65 # This file is built.  However gdk_pixbuf_mlsource requires X11 to
66 # run, which prevents this from being built in places where an X
67 # display is not available, such as on automated builders.  So we'll
68 # bundle this file in with the tarball anyway.
69 throbber.ml: Throbber.png Throbber.gif
70         $(GDK_PIXBUF_MLSOURCE) --build-list \
71           static Throbber.png \
72           animation Throbber.gif \
73           > $@-t && mv $@-t $@
74
75 .mli.cmi:
76         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
77 .ml.cmo:
78         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
79 .ml.cmx:
80         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
81
82 depend: .depend
83
84 .depend: $(wildcard *.mli) $(wildcard *.ml)
85         rm -f $@ $@-t
86         $(OCAMLFIND) ocamldep $^ > $@-t
87         mv $@-t $@
88
89 include .depend