Add file properties dialog.
[guestfs-browser.git] / Makefile.am
index 9e02e88..8f811ad 100644 (file)
@@ -1,5 +1,5 @@
 # Guestfs Browser.
-# Copyright (C) 2010 Red Hat Inc.
+# Copyright (C) 2010-2011 Red Hat Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 ACLOCAL_AMFLAGS = -I m4
 
-EXTRA_DIST = HACKING Throbber.png Throbber.gif
+EXTRA_DIST = \
+       $(SOURCES) \
+       HACKING \
+       Throbber.png Throbber.gif \
+       .gitignore \
+       guestfs-browser.pod \
+       guestfs-browser.1 \
+       guestfs-browser.desktop.in \
+       guestfs-browser.png \
+       guestfs-browser-large.png \
+       guestfs-browser.svg \
+       test-desktop-file-validate.sh \
+       html/pod.css
 
-CLEANFILES = *.cmi *.cmo *.cmx *.o guestfs-browser throbber.ml
+CLEANFILES = *.cmi *.cmo *.cmx *.cmxa *.o guestfs-browser *~
 
+TESTS =
+
+# These are listed here in alphabetical order.
 SOURCES = \
+       cmdline.mli \
+       cmdline.ml \
+       config.mli \
+       deviceSet.mli \
+       deviceSet.ml \
+       filetree.mli \
+       filetree.ml \
+       filetree_markup.mli \
+       filetree_markup.ml \
        main.ml \
+       menu_about.mli \
+       menu_about.ml \
+       menu_open_disk.mli \
+       menu_open_disk.ml \
+       menu_open_uri.mli \
+       menu_open_uri.ml \
+       op_checksum_file.mli \
+       op_checksum_file.ml \
+       op_copy_regvalue.mli \
+       op_copy_regvalue.ml \
+       op_disk_usage.mli \
+       op_disk_usage.ml \
+       op_download_as_reg.mli \
+       op_download_as_reg.ml \
+       op_download_dir_find0.mli \
+       op_download_dir_find0.ml \
+       op_download_dir_tarball.mli \
+       op_download_dir_tarball.ml \
+       op_download_file.mli \
+       op_download_file.ml \
+       op_file_information.mli \
+       op_file_information.ml \
+       op_file_properties.mli \
+       op_file_properties.ml \
+       op_inspection_dialog.mli \
+       op_inspection_dialog.ml \
+       op_view_file.mli \
+       op_view_file.ml \
        slave.mli \
        slave.ml \
+       slave_types.mli \
+       slave_types.ml \
+       slave_utils.mli \
+       slave_utils.ml \
        throbber.ml \
        utils.mli \
-       utils.ml
+       utils.ml \
+       window.mli \
+       window.ml
+
+BUILT_SOURCES = \
+       config.ml
 
+# Note this list must be in dependency order.
 OBJECTS = \
-       main.cmx \
-       slave.cmx \
-       throbber.cmx \
-       utils.cmx
+       config.cmo \
+       throbber.cmo \
+       utils.cmo \
+       cmdline.cmo \
+       deviceSet.cmo \
+       slave_types.cmo \
+       slave_utils.cmo \
+       slave.cmo \
+       filetree_markup.cmo \
+       filetree.cmo \
+       op_checksum_file.cmo \
+       op_copy_regvalue.cmo \
+       op_disk_usage.cmo \
+       op_download_as_reg.cmo \
+       op_download_dir_find0.cmo \
+       op_download_dir_tarball.cmo \
+       op_download_file.cmo \
+       op_file_information.cmo \
+       op_file_properties.cmo \
+       op_inspection_dialog.cmo \
+       op_view_file.cmo \
+       menu_open_uri.cmo \
+       menu_open_disk.cmo \
+       menu_about.cmo \
+       window.cmo \
+       main.cmo
+
+XOBJECTS = $(OBJECTS:.cmo=.cmx)
 
 bin_SCRIPTS = guestfs-browser
 
-OCAMLOPTFLAGS = \
-       -warn-error A \
+OCAMLPACKAGES = \
+       -package libvirt,guestfs,hivex,lablgtk2,extlib,xml-light,calendar,camomile,threads,bitstring,bitstring.syntax -syntax bitstring
+OCAMLCFLAGS = \
+       -g \
+       -warn-error CDEFLMPSUVYZX \
        -thread \
-       -package libvirt,guestfs,lablgtk2,extlib,xml-light,threads
+       $(OCAMLPACKAGES) \
+       -predicates threads
+OCAMLOPTFLAGS = \
+       -ccopt -g \
+       $(OCAMLCFLAGS)
+OCAMLDOCFLAGS = \
+       $(OCAMLPACKAGES) \
+       -predicates threads \
+       -I +threads \
+       -sort -html
 
-guestfs-browser: $(OBJECTS)
-       ocamlfind ocamlopt $(OCAMLOPTFLAGS) \
+if HAVE_OCAMLOPT
+guestfs-browser: $(XOBJECTS)
+       $(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) \
          -predicates init,threads \
          -linkpkg gtkThread.cmx \
          $^ -o $@
+else
+guestfs-browser: $(OBJECTS)
+       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) \
+         -predicates init,threads \
+         -linkpkg gtkThread.cmo \
+         $^ -o $@
+endif
 
+# This file is built.  However gdk_pixbuf_mlsource requires X11 to
+# run, which prevents this from being built in places where an X
+# display is not available, such as on automated builders.  So we'll
+# bundle this file in with the tarball anyway.
 throbber.ml: Throbber.png Throbber.gif
-       gdk_pixbuf_mlsource --build-list \
+       $(GDK_PIXBUF_MLSOURCE) --build-list \
          static Throbber.png \
          animation Throbber.gif \
          > $@-t && mv $@-t $@
+
+.mli.cmi:
+       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
+.ml.cmo:
+       $(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -c $< -o $@
+.ml.cmx:
+       $(OCAMLFIND) ocamlopt $(OCAMLCFLAGS) -c $< -o $@
+
+# Icon.
+icondir = $(datadir)/$(PACKAGE_NAME)/pixmaps
+icon_DATA = guestfs-browser.svg guestfs-browser-large.png guestfs-browser.png
+
+# Desktop file.
+desktopdir = $(datadir)/applications
+desktop_DATA = guestfs-browser.desktop
+
+guestfs-browser.desktop: guestfs-browser.desktop.in Makefile
+       $(SED) "s,\@icondir\@,$(icondir),g" < $< > $@-t
+       mv $@-t $@
+
+TESTS += test-desktop-file-validate.sh
+
+# Config.  Can't use autoconf to build this because we want
+# to embed the true icondir path.
+config.ml: config.ml.in Makefile
+       < $< \
+       $(SED) \
+         -e "s,\@PACKAGE_NAME\@,$(PACKAGE_NAME),g" \
+         -e "s,\@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g" \
+         -e "s,\@HIVEXREGEDIT\@,$(HIVEXREGEDIT),g" \
+         -e "s,\@OPENER\@,$(OPENER),g" \
+         -e "s,\@icondir\@,$(icondir),g" \
+         > $@-t
+       mv $@-t $@
+
+# Man page.
+man_MANS = guestfs-browser.1
+
+if HAVE_PERLDOC
+
+guestfs-browser.1: guestfs-browser.pod
+       pod2man \
+         --section 1 \
+         -c "Virtualization Support" \
+         --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
+         $< > $@
+
+noinst_DATA = \
+       html/guestfs-browser.1.html
+
+html/guestfs-browser.1.html: guestfs-browser.pod
+       mkdir -p html
+       pod2html \
+         --css 'pod.css' \
+         --htmldir html \
+         --outfile html/guestfs-browser.1.html \
+         guestfs-browser.pod
+
+endif
+
+# Maintainer website update.
+HTMLFILES = \
+       html/guestfs-browser.1.html
+
+WEBSITEDIR = $(HOME)/d/redhat/websites/libguestfs
+
+website: $(HTMLFILES)
+       cp $(HTMLFILES) $(WEBSITEDIR)
+
+CLEANFILES += $(HTMLFILES) pod2*.tmp
+
+# Convert internal documentation to HTML.
+docs:
+       rm -rf doc
+       mkdir -p doc
+       $(OCAMLFIND) ocamldoc -d doc $(OCAMLDOCFLAGS) $(SOURCES)
+
+# Dependencies.
+depend: .depend
+
+.depend: $(wildcard *.mli) $(wildcard *.ml)
+       $(OCAMLFIND) ocamldep $(OCAMLPACKAGES) $^ | \
+         $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
+         sort > $@-t
+       mv $@-t $@
+
+include .depend
+
+.PHONY: depend docs