summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Kerneis2014-08-24 09:00:12 +0200
committerGabriel Kerneis2014-08-24 09:00:12 +0200
commit9b89699fa5c6c6a8fb5ff2ae5bbb010853b2d5cb (patch)
tree296edf66581996b9e34e2d9dc79d118a0ab38805 /src
parentcf236dc90b7e091da0929df055c88e0093a70f41 (diff)
Use LEM_DIR environment variable if defined
LEM_DIR must contain the *absolute* path the Lem directory. If not defined, the previous behaviour is retained: a relative path is used, assuming Lem is in bitbucket/lem.
Diffstat (limited to 'src')
-rw-r--r--src/myocamlbuild.ml13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/myocamlbuild.ml b/src/myocamlbuild.ml
index 5ba172cb..f1fa7a88 100644
--- a/src/myocamlbuild.ml
+++ b/src/myocamlbuild.ml
@@ -16,20 +16,13 @@ let split ch s =
go s
(* paths relative to _build *)
-let lem_dir = "../../../lem" ;;
+let lem_dir =
+ try Sys.getenv "LEM_DIR" (* LEM_DIR must contain an absolute path *)
+ with Not_found -> "../../../lem" ;;
let lem_libdir = lem_dir / "ocaml-lib/_build" ;;
let lem_lib = lem_libdir / "extract" ;;
let lem = lem_dir / "lem" ;;
-(* Order matters - respect dependencies! *)
-let lem_deps = List.map ((/) "lem_interp") [
- "interp_ast.lem";
- "interp.lem";
- "interp_lib.lem";
- ] ;;
-let lem_opts = List.fold_right (fun s l -> [A "-i"; P s] @ l) lem_deps [] ;;
-
-(* New library magic: *)
(* All -wl ignores should be removed if you want to see the pattern compilation, exhaustive, and unused var warnings *)
let lem_opts = [A "-lib"; P "../lem_interp";
A "-wl_pat_comp"; P "ign";