Add Reopen option to the menu.
[guestfs-browser.git] / Makefile.am
1 # Guestfs Browser.
2 # Copyright (C) 2010-2011 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 \
25         guestfs-browser.pod \
26         guestfs-browser.1 \
27         guestfs-browser.desktop.in \
28         guestfs-browser.png \
29         guestfs-browser-large.png \
30         guestfs-browser.svg \
31         test-desktop-file-validate.sh \
32         html/pod.css
33
34 CLEANFILES = *.cmi *.cmo *.cmx *.cmxa *.o guestfs-browser *~
35
36 TESTS =
37
38 # These are listed here in alphabetical order.
39 SOURCES = \
40         cmdline.mli \
41         cmdline.ml \
42         config.mli \
43         config.ml \
44         deviceSet.mli \
45         deviceSet.ml \
46         filetree.mli \
47         filetree.ml \
48         filetree_markup.mli \
49         filetree_markup.ml \
50         main.ml \
51         op_checksum_file.mli \
52         op_checksum_file.ml \
53         op_copy_regvalue.mli \
54         op_copy_regvalue.ml \
55         op_disk_usage.mli \
56         op_disk_usage.ml \
57         op_download_as_reg.mli \
58         op_download_as_reg.ml \
59         op_download_dir_find0.mli \
60         op_download_dir_find0.ml \
61         op_download_dir_tarball.mli \
62         op_download_dir_tarball.ml \
63         op_download_file.mli \
64         op_download_file.ml \
65         op_file_information.mli \
66         op_file_information.ml \
67         op_inspection_dialog.mli \
68         op_inspection_dialog.ml \
69         op_view_file.mli \
70         op_view_file.ml \
71         slave.mli \
72         slave.ml \
73         slave_types.mli \
74         slave_types.ml \
75         slave_utils.mli \
76         slave_utils.ml \
77         throbber.ml \
78         utils.mli \
79         utils.ml \
80         window.mli \
81         window.ml
82
83 # Note this list must be in dependency order.
84 OBJECTS = \
85         config.cmo \
86         throbber.cmo \
87         utils.cmo \
88         cmdline.cmo \
89         deviceSet.cmo \
90         slave_types.cmo \
91         slave_utils.cmo \
92         slave.cmo \
93         filetree_markup.cmo \
94         filetree.cmo \
95         op_checksum_file.cmo \
96         op_copy_regvalue.cmo \
97         op_disk_usage.cmo \
98         op_download_as_reg.cmo \
99         op_download_dir_find0.cmo \
100         op_download_dir_tarball.cmo \
101         op_download_file.cmo \
102         op_file_information.cmo \
103         op_inspection_dialog.cmo \
104         op_view_file.cmo \
105         window.cmo \
106         main.cmo
107
108 XOBJECTS = $(OBJECTS:.cmo=.cmx)
109
110 bin_SCRIPTS = guestfs-browser
111
112 OCAMLPACKAGES = \
113         -package libvirt,guestfs,hivex,lablgtk2,extlib,xml-light,camomile,threads,bitstring,bitstring.syntax -syntax bitstring
114 OCAMLCFLAGS = \
115         -g \
116         -warn-error CDEFLMPSUVYZX \
117         -thread \
118         $(OCAMLPACKAGES) \
119         -predicates threads
120 OCAMLOPTFLAGS = \
121         -ccopt -g \
122         $(OCAMLCFLAGS)
123 OCAMLDOCFLAGS = \
124         $(OCAMLPACKAGES) \
125         -predicates threads \
126         -I +threads \
127         -sort -html
128
129 if HAVE_OCAMLOPT
130 guestfs-browser: $(XOBJECTS)
131         $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
132           -predicates init,threads \
133           -linkpkg gtkThread.cmx \
134           $^ -o $@
135 else
136 guestfs-browser: $(OBJECTS)
137         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
138           -predicates init,threads \
139           -linkpkg gtkThread.cmo \
140           $^ -o $@
141 endif
142
143 # This file is built.  However gdk_pixbuf_mlsource requires X11 to
144 # run, which prevents this from being built in places where an X
145 # display is not available, such as on automated builders.  So we'll
146 # bundle this file in with the tarball anyway.
147 throbber.ml: Throbber.png Throbber.gif
148         $(GDK_PIXBUF_MLSOURCE) --build-list \
149           static Throbber.png \
150           animation Throbber.gif \
151           > $@-t && mv $@-t $@
152
153 .mli.cmi:
154         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
155 .ml.cmo:
156         $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
157 .ml.cmx:
158         $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
159
160 # Icon.
161 icondir = $(datadir)/$(PACKAGE_NAME)/pixmaps
162 icon_DATA = guestfs-browser.svg guestfs-browser-large.png guestfs-browser.png
163
164 # Desktop file.
165 desktopdir = $(datadir)/applications
166 desktop_DATA = guestfs-browser.desktop
167
168 guestfs-browser.desktop: guestfs-browser.desktop.in
169         $(SED) "s,\@icondir\@,$(icondir),g" < $< > $@
170
171 TESTS += test-desktop-file-validate.sh
172
173 # Man page.
174 man_MANS = guestfs-browser.1
175
176 if HAVE_PERLDOC
177
178 guestfs-browser.1: guestfs-browser.pod
179         pod2man \
180           --section 1 \
181           -c "Virtualization Support" \
182           --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
183           $< > $@
184
185 noinst_DATA = \
186         html/guestfs-browser.1.html
187
188 html/guestfs-browser.1.html: guestfs-browser.pod
189         mkdir -p html
190         pod2html \
191           --css 'pod.css' \
192           --htmldir html \
193           --outfile html/guestfs-browser.1.html \
194           guestfs-browser.pod
195
196 endif
197
198 # Maintainer website update.
199 HTMLFILES = \
200         html/guestfs-browser.1.html
201
202 WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
203
204 website: $(HTMLFILES)
205         cp $(HTMLFILES) $(WEBSITEDIR)
206
207 CLEANFILES += $(HTMLFILES) pod2*.tmp
208
209 # Convert internal documentation to HTML.
210 docs:
211         rm -rf doc
212         mkdir -p doc
213         $(OCAMLFIND) ocamldoc -d doc $(OCAMLDOCFLAGS) $(SOURCES)
214
215 # Dependencies.
216 depend: .depend
217
218 .depend: $(wildcard *.mli) $(wildcard *.ml)
219         rm -f $@ $@-t
220         $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) $^ | \
221           $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
222           sort > $@-t
223         mv $@-t $@
224
225 include .depend
226
227 .PHONY: depend docs