Jbuilder: fix dependencies in the tezos-compiler
hack
This commit is contained in:
parent
d417a679e6
commit
0f0ec6ab7a
@ -152,12 +152,14 @@ let main { compile_ml ; pack_objects ; link_shared } =
|
|||||||
let anonymous = ref []
|
let anonymous = ref []
|
||||||
and static = ref false
|
and static = ref false
|
||||||
and register = ref false
|
and register = ref false
|
||||||
and build_dir = ref None in
|
and build_dir = ref None
|
||||||
|
and output_dep = ref false in
|
||||||
let args_spec = [
|
let args_spec = [
|
||||||
"-static", Arg.Set static, " Only build the static library (no .cmxs)";
|
"-static", Arg.Set static, " Only build the static library (no .cmxs)";
|
||||||
"-register", Arg.Set register, " Generete the `Registerer` module";
|
"-register", Arg.Set register, " Generete the `Registerer` module";
|
||||||
"-bin-annot", Arg.Set Clflags.binary_annotations, " (see ocamlopt)" ;
|
"-bin-annot", Arg.Set Clflags.binary_annotations, " (see ocamlopt)" ;
|
||||||
"-g", Arg.Set Clflags.debug, " (see ocamlopt)" ;
|
"-g", Arg.Set Clflags.debug, " (see ocamlopt)" ;
|
||||||
|
"-output-dep", Arg.Set output_dep, " ..." ;
|
||||||
"-build-dir", Arg.String (fun s -> build_dir := Some s),
|
"-build-dir", Arg.String (fun s -> build_dir := Some s),
|
||||||
"use custom build directory and preserve build artifacts"
|
"use custom build directory and preserve build artifacts"
|
||||||
] in
|
] in
|
||||||
@ -239,4 +241,15 @@ let main { compile_ml ; pack_objects ; link_shared } =
|
|||||||
if not !static then begin
|
if not !static then begin
|
||||||
Clflags.link_everything := true ;
|
Clflags.link_everything := true ;
|
||||||
link_shared (output ^ ".cmxs") [resulting_object] ;
|
link_shared (output ^ ".cmxs") [resulting_object] ;
|
||||||
|
end ;
|
||||||
|
|
||||||
|
if !output_dep then begin
|
||||||
|
let dsrc = Digest.file functor_file in
|
||||||
|
let dimpl = Digest.file resulting_object in
|
||||||
|
let dintf = Digest.file (Filename.chop_extension resulting_object ^ ".cmi") in
|
||||||
|
Format.printf "module Toto = struct include %s end ;; \n" for_pack ;
|
||||||
|
Format.printf "let src_digest = %S ;;\n" (Digest.to_hex dsrc) ;
|
||||||
|
Format.printf "let impl_digest = %S ;;\n" (Digest.to_hex dimpl) ;
|
||||||
|
Format.printf "let intf_digest = %S ;;\n" (Digest.to_hex dintf)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ let () = Format.kasprintf Jbuild_plugin.V1.send {|
|
|||||||
src/TEZOS_PROTOCOL))
|
src/TEZOS_PROTOCOL))
|
||||||
(action (with-stdout-to ${path-no-dep:tezos_protocol_%s_dummy_byte.ml}
|
(action (with-stdout-to ${path-no-dep:tezos_protocol_%s_dummy_byte.ml}
|
||||||
(chdir ${ROOT}
|
(chdir ${ROOT}
|
||||||
(run ${bin:tezos-protocol-compiler-byte} -static ${path-no-dep:tezos_protocol_%s} ${path-no-dep:src}))))))
|
(run ${bin:tezos-protocol-compiler-byte} -static -output-dep ${path-no-dep:tezos_protocol_%s} ${path-no-dep:src}))))))
|
||||||
|
|
||||||
(rule
|
(rule
|
||||||
((targets (tezos_protocol_%s.o
|
((targets (tezos_protocol_%s.o
|
||||||
@ -72,7 +72,7 @@ let () = Format.kasprintf Jbuild_plugin.V1.send {|
|
|||||||
src/TEZOS_PROTOCOL))
|
src/TEZOS_PROTOCOL))
|
||||||
(action (with-stdout-to ${path-no-dep:tezos_protocol_%s_dummy.ml}
|
(action (with-stdout-to ${path-no-dep:tezos_protocol_%s_dummy.ml}
|
||||||
(chdir ${ROOT}
|
(chdir ${ROOT}
|
||||||
(run ${bin:tezos-protocol-compiler} -static ${path-no-dep:tezos_protocol_%s} ${path-no-dep:src}))))))
|
(run ${bin:tezos-protocol-compiler} -static -output-dep ${path-no-dep:tezos_protocol_%s} ${path-no-dep:src}))))))
|
||||||
|
|
||||||
(library
|
(library
|
||||||
((name tezos_protocol_%s)
|
((name tezos_protocol_%s)
|
||||||
|
Loading…
Reference in New Issue
Block a user