Commit fcd33f79 authored by bguillaum's avatar bguillaum

version 2.23: compilation of the GUI is optional, mv from camlp4 to cppo


git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/semagramme/dep2pict/trunk@9061 7838e531-6607-4d57-9587-6c381814729c
parent 769801bf
......@@ -5,24 +5,50 @@ DATA_DIR=$(PREFIX)/share/dep2pict/
OCB_FLAGS = -use-ocamlfind -I src
OCB = ocamlbuild $(OCB_FLAGS)
GUI = -pkgs 'lablgtk2, lablgtk2.rsvg, lablgtk2.glade, lablwebkit'
VERSION = `cat VERSION`
all: native
native: src/dep2pict_glade.ml datadir
native: datadir
ifeq ($(shell ocamlfind query lablwebkit),)
@make native_nogui
else
@make native_gui
endif
native_nogui:
echo "no" > GUI
$(OCB) main.native
native_gui: src/dep2pict_glade.ml
echo "yes" > GUI
sed -iback 's|src/dep2pict.glade|$(DATA_DIR)dep2pict.glade|g' src/dep2pict_glade.ml
rm -f src/dep2pict_glade.mlback
$(OCB) main.native
$(OCB) $(GUI) main.native
datadir:
echo $(DATA_DIR) > DATA_DIR
install: native
install:
ifeq ($(shell ocamlfind query lablwebkit),)
@make install_nogui
else
@make install_gui
endif
install_gui: native_gui
cp main.native $(BINDIR)/dep2pict
mkdir -p $(DATA_DIR)/examples
cp src/dep2pict.glade $(DATA_DIR)
cp examples/*.dep examples/*.conll $(DATA_DIR)
install_nogui: native_nogui
cp main.native $(BINDIR)/dep2pict
mkdir -p $(DATA_DIR)/examples
cp examples/*.dep examples/*.conll $(DATA_DIR)
uninstall:
rm -f $(BINDIR)/dep2pict
rm -f $(DATA_DIR)/dep2pict.glade
......@@ -32,6 +58,7 @@ uninstall:
clean:
$(OCB) -clean
rm -f src/dep2pict_glade.ml
rm -f GUI DATA_DIR
info:
@echo "BINDIR = $(BINDIR)"
......
true: package(str, ANSITerminal, camomile, cairo2, log, conll, dep2pict, lablgtk2, lablgtk2.rsvg, lablgtk2.glade, lablwebkit)
true: package(str, ANSITerminal, camomile, cairo2, log, conll, dep2pict)
......@@ -11,7 +11,11 @@ let read file =
let () =
dispatch begin function
| After_rules ->
let pp_src = S[A"-pp"; A("camlp4o pa_macro.cmo -DDATA_DIR=\\\""^(read "DATA_DIR")^"\\\" -DVERSION=\\\""^(read "VERSION")^"\\\"")] in
let data_dir = "\""^(read "DATA_DIR")^"\""
and version = "\""^(read "VERSION")^"\"" in
let pp_src = match read "GUI" with
| "yes" -> S[A"-pp"; A("cppo -D 'GUI' -D 'VERSION "^version^"' -D 'DATA_DIR "^data_dir^"'")]
| _ -> S[A"-pp"; A("cppo -D 'VERSION "^version^"' -D 'DATA_DIR "^data_dir^"'")] in
flag ["ocaml"; "ocamldep"] & pp_src;
flag ["ocaml"; "compile"] & pp_src;
| _ -> ()
......
A program (command line and GTK GUI) to draw linguistic dependencies (see dep2pict.loria.fr)
A command line program to draw linguistic dependencies (see dep2pict.loria.fr).
If lablwebkit is available at compilation time, a GTK GUI is also available.
......@@ -11,11 +11,14 @@ remove: [
["make" "uninstall" "PREFIX=%{prefix}%"]
]
depends: [
"cppo"
"ANSITerminal"
"libcaml-log"
"cairo2"
"camomile"
"libcaml-dep2pict"
]
depopts: [
"lablgtk"
"lablwebkit"
"libcaml-dep2pict"
]
......@@ -22,9 +22,11 @@ let usage = String.concat "\n" [
"=-=-=-=-= dep2pict: a tool to draw dependency graphs =-=-=-=-=";
"";
"Usage:";
" * dep2pict <options> input_file output_file convert input_file into output_file" ;
" * dep2pict <options> input_file output_file convert input_file into output_file";
#ifdef GUI
" * dep2pict <options> input_file run the GUI with the given file";
" * dep2pict <options> run the GUI with an empty graph";
#endif
" * dep2pict (-h | --help) display this help";
" * dep2pict (-v | --version) display version number ("^version^")";
......@@ -88,7 +90,12 @@ let _ =
(* check for input_file and load file if any *)
match !output_file with
| None -> Gui.main ()
| None ->
#ifdef GUI
Gui.main ()
#else
Log.warning "Dep2pict was compiled without lablwebkit, the GUI in not available"; exit 0
#endif
| Some out_file ->
load !input_file;
set_position ();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment