Add COPYING file, internal HTML documentation, and RPM spec file.
[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 OCAMLPACKAGES = libvirt,guestfs,lablgtk2,extlib,xml-light,threads
52 OCAMLCFLAGS = \
53         -g \
54         -warn-error A \
55         -thread \
56         -package $(OCAMLPACKAGES) \
57         -predicates threads
58 OCAMLOPTFLAGS = $(OCAMLCFLAGS)
59 OCAMLDOCFLAGS = \
60         -package $(OCAMLPACKAGES) \
61         -predicates threads \
62         -I +threads \
63         -sort -html
64
65 guestfs-browser: $(OBJECTS)
66         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
67           -predicates init,threads \
68           -linkpkg gtkThread.cmx \
69           $^ -o $@
70
71 # This file is built.  However gdk_pixbuf_mlsource requires X11 to
72 # run, which prevents this from being built in places where an X
73 # display is not available, such as on automated builders.  So we'll
74 # bundle this file in with the tarball anyway.
75 throbber.ml: Throbber.png Throbber.gif
76         $(GDK_PIXBUF_MLSOURCE) --build-list \
77           static Throbber.png \
78           animation Throbber.gif \
79           > $@-t && mv $@-t $@
80
81 .mli.cmi:
82         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
83 .ml.cmo:
84         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
85 .ml.cmx:
86         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
87
88 # Convert internal documentation to HTML.
89 docs:
90         rm -rf doc
91         mkdir -p doc
92         $(OCAMLFIND) ocamldoc -d doc $(OCAMLDOCFLAGS) $(SOURCES)
93
94 # Dependencies.
95 depend: .depend
96
97 .depend: $(wildcard *.mli) $(wildcard *.ml)
98         rm -f $@ $@-t
99         $(OCAMLFIND) ocamldep $^ > $@-t
100         mv $@-t $@
101
102 include .depend
103
104 .PHONY: depend docs