Skip to content
Snippets Groups Projects
Commit 1e82ed48 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Add a -2c-exec option that launches the exec file

parent 1cffc6b4
No related branches found
No related tags found
No related merge requests found
OASISFormat: 0.4 OASISFormat: 0.4
Name: lustre-v6 Name: lustre-v6
Version: 1.673 Version: 1.674
Synopsis: The Lustre V6 Verimag compiler Synopsis: The Lustre V6 Verimag compiler
Description: This package contains: Description: This package contains:
(1) lus2lic: the (current) name of the compiler (and interpreter via -exec). (1) lus2lic: the (current) name of the compiler (and interpreter via -exec).
......
(* Time-stamp: <modified the 19/10/2016 (at 15:30) by Erwan Jahier> *) (* Time-stamp: <modified the 22/12/2016 (at 16:20) by jahier> *)
(* (*
Le manager d'argument adapt de celui de lutin, plus joli Le manager d'argument adapt de celui de lutin, plus joli
N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global, N.B. solution un peu batarde : les options sont stockes, comme avant, dans Global,
...@@ -41,6 +41,7 @@ type t = { ...@@ -41,6 +41,7 @@ type t = {
mutable rif : bool; mutable rif : bool;
mutable gen_ocaml : bool; mutable gen_ocaml : bool;
mutable launch_cc : bool; mutable launch_cc : bool;
mutable launch_exec : bool;
mutable precision : int option; mutable precision : int option;
} }
...@@ -123,7 +124,7 @@ let (make_opt : unit -> t) = ...@@ -123,7 +124,7 @@ let (make_opt : unit -> t) =
gen_ocaml = false; gen_ocaml = false;
precision = None; precision = None;
launch_cc = false; launch_cc = false;
launch_exec = false;
} }
...@@ -288,6 +289,11 @@ let mkoptab (opt:t) : unit = ( ...@@ -288,6 +289,11 @@ let mkoptab (opt:t) : unit = (
(Arg.Unit (fun i -> set_c_options opt; opt.launch_cc <- true)) (Arg.Unit (fun i -> set_c_options opt; opt.launch_cc <- true))
["Try to compile the generated C files (force -2c)"] ["Try to compile the generated C files (force -2c)"]
; ;
mkopt opt
["-2c-exec";"--to-c-execute"]
(Arg.Unit (fun i -> set_c_options opt; opt.launch_cc <- true; opt.launch_exec <- true))
["Try to execute the generated C files (force -cc)."]
;
mkopt opt mkopt opt
["-rif"] ["-rif"]
(Arg.Unit(function s -> opt.rif <- true)) (Arg.Unit(function s -> opt.rif <- true))
......
...@@ -44,6 +44,7 @@ type t = { ...@@ -44,6 +44,7 @@ type t = {
mutable rif : bool; mutable rif : bool;
mutable gen_ocaml : bool; mutable gen_ocaml : bool;
mutable launch_cc : bool; mutable launch_cc : bool;
mutable launch_exec : bool;
mutable precision : int option; mutable precision : int option;
} }
......
(** Automatically generated from Makefile *) (** Automatically generated from Makefile *)
let tool = "lus2lic" let tool = "lus2lic"
let branch = "master" let branch = "master"
let commit = "673" let commit = "674"
let sha_1 = "3caa7c5886de6bfb05fcecd562eb21f151cad066" let sha_1 = "1cffc6b49d46a14e9edfd05a678b56e00466682e"
let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")") let str = (branch ^ "." ^ commit ^ " (" ^ sha_1 ^ ")")
let maintainer = "jahier@imag.fr" let maintainer = "jahier@imag.fr"
(* Time-stamp: <modified the 22/11/2016 (at 14:16) by Erwan Jahier> *) (* Time-stamp: <modified the 22/12/2016 (at 16:14) by jahier> *)
(* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *) (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
...@@ -1057,8 +1057,15 @@ fi ...@@ -1057,8 +1057,15 @@ fi
close_out types_h_oc; close_out types_h_oc;
close_out ocsh; close_out ocsh;
let call_script = "sh "^node^".sh" in let call_script = "sh "^node^".sh" in
let call_exec = "./"^node^".exec" in
if args.Lv6MainArgs.launch_cc then ( if args.Lv6MainArgs.launch_cc then (
if (Sys.command call_script)=0 then () else if (Sys.command call_script)=0 then (
if args.Lv6MainArgs.launch_exec then (
if (Sys.command call_exec)=0 then (
) else
print_string ("sys call: '"^call_exec^"' failed\n")
)
) else
print_string ("sys call: '"^call_script^"' failed\n") print_string ("sys call: '"^call_script^"' failed\n")
) else ) else
print_string ("you can compile those files calling: "^call_script^"\n"); print_string ("you can compile those files calling: "^call_script^"\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment