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