tezos-compiler: better arguments, add doc
This commit is contained in:
parent
ec79241adb
commit
f3b7299662
@ -315,7 +315,7 @@ proto/embedded_proto_%.cmxa: \
|
|||||||
proto/%/TEZOS_PROTOCOL \
|
proto/%/TEZOS_PROTOCOL \
|
||||||
$$(wildcard proto/%/*.ml) \
|
$$(wildcard proto/%/*.ml) \
|
||||||
$$(wildcard proto/%/*.mli)
|
$$(wildcard proto/%/*.mli)
|
||||||
@${TZCOMPILER} --build-dir proto/$*/_tzbuild $@ proto/$*/
|
@${TZCOMPILER} -static -build-dir proto/$*/_tzbuild $@ proto/$*/
|
||||||
|
|
||||||
CLIENT_PROTO_INCLUDES := \
|
CLIENT_PROTO_INCLUDES := \
|
||||||
utils node/updater node/db node/net node/shell client \
|
utils node/updater node/db node/net node/shell client \
|
||||||
@ -328,7 +328,7 @@ proto/client_embedded_proto_%.cmxa: \
|
|||||||
proto/%/TEZOS_PROTOCOL \
|
proto/%/TEZOS_PROTOCOL \
|
||||||
$$(wildcard proto/%/*.ml) \
|
$$(wildcard proto/%/*.ml) \
|
||||||
$$(wildcard proto/%/*.mli)
|
$$(wildcard proto/%/*.mli)
|
||||||
@./${TZCOMPILER} --client --build-dir client/embedded/$*/_tzbuild \
|
@./${TZCOMPILER} -static -client -build-dir client/embedded/$*/_tzbuild \
|
||||||
$(addprefix -I , ${CLIENT_PROTO_INCLUDES}) \
|
$(addprefix -I , ${CLIENT_PROTO_INCLUDES}) \
|
||||||
$@ proto/$*
|
$@ proto/$*
|
||||||
|
|
||||||
|
@ -36,11 +36,6 @@ module Backend = struct
|
|||||||
end
|
end
|
||||||
let backend = (module Backend : Backend_intf.S)
|
let backend = (module Backend : Backend_intf.S)
|
||||||
|
|
||||||
let usage () =
|
|
||||||
Printf.eprintf
|
|
||||||
"Usage: %s output.cmxs source_dir [--in-place]\n%!"
|
|
||||||
Sys.argv.(0)
|
|
||||||
|
|
||||||
let warnings = "+a-4-6-7-9-29-40..42-44-45-48"
|
let warnings = "+a-4-6-7-9-29-40..42-44-45-48"
|
||||||
let warn_error = "-a"
|
let warn_error = "-a"
|
||||||
|
|
||||||
@ -215,11 +210,11 @@ let pack_objects ?(ctxt = "") ?(keep_object = false) output objects =
|
|||||||
if not keep_object then at_exit (fun () -> unlink_object output) ;
|
if not keep_object then at_exit (fun () -> unlink_object output) ;
|
||||||
Warnings.check_fatal ()
|
Warnings.check_fatal ()
|
||||||
|
|
||||||
let link_shared output objects =
|
let link_shared ?(static=false) output objects =
|
||||||
Printf.printf "LINK %s\n%!" (Filename.basename output);
|
Printf.printf "LINK %s\n%!" (Filename.basename output);
|
||||||
Compenv.(readenv Format.err_formatter Before_link);
|
Compenv.(readenv Format.err_formatter Before_link);
|
||||||
Compmisc.init_path true;
|
Compmisc.init_path true;
|
||||||
if Filename.check_suffix output ".cmxa" then
|
if static then
|
||||||
Asmlibrarian.create_archive objects output
|
Asmlibrarian.create_archive objects output
|
||||||
else
|
else
|
||||||
Asmlink.link_shared Format.err_formatter objects output;
|
Asmlink.link_shared Format.err_formatter objects output;
|
||||||
@ -283,12 +278,14 @@ let main () =
|
|||||||
and client = ref false
|
and client = ref false
|
||||||
and build_dir = ref None
|
and build_dir = ref None
|
||||||
and include_dirs = ref [] in
|
and include_dirs = ref [] in
|
||||||
|
let static = ref false in
|
||||||
let args_spec = [
|
let args_spec = [
|
||||||
"--client", Arg.Set client, "TODO" ;
|
"-static", Arg.Set static, " Build a library (.cmxa)";
|
||||||
"-I", Arg.String (fun s -> include_dirs := s :: !include_dirs), "TODO" ;
|
"-client", Arg.Set client, " Preserve type equality with concrete node environment (used to embed protocol into the client)" ;
|
||||||
"--build-dir", Arg.String (fun s -> build_dir := Some s), "TODO"] in
|
"-I", Arg.String (fun s -> include_dirs := s :: !include_dirs), "path Path for concrete node signatures (used to embed protocol into the client)" ;
|
||||||
let usage_msg = "TODO" in
|
"-build-dir", Arg.String (fun s -> build_dir := Some s), "path Reuse build dir (incremental compilation)"] in
|
||||||
Arg.parse args_spec (fun s -> anonymous := s :: !anonymous) "TODO" ;
|
let usage_msg = Printf.sprintf "Usage: %s <out> <src>\nOptions are:" Sys.argv.(0) in
|
||||||
|
Arg.parse args_spec (fun s -> anonymous := s :: !anonymous) usage_msg ;
|
||||||
|
|
||||||
let client = !client and include_dirs = !include_dirs in
|
let client = !client and include_dirs = !include_dirs in
|
||||||
let output, source_dir =
|
let output, source_dir =
|
||||||
@ -439,4 +436,4 @@ let main () =
|
|||||||
|
|
||||||
(* Create the final [cmxs] *)
|
(* Create the final [cmxs] *)
|
||||||
Clflags.link_everything := true ;
|
Clflags.link_everything := true ;
|
||||||
link_shared output [packed_objects; register_object]
|
link_shared ~static:!static output [packed_objects; register_object]
|
||||||
|
Loading…
Reference in New Issue
Block a user