Revision b2ad5de3
Added by LĂ©lio Brun over 3 years ago
src/backends/C/c_backend_makefile.ml | ||
---|---|---|
53 | 53 |
[] |
54 | 54 |
deps |
55 | 55 |
|
56 |
let fprintf_dependencies fmt (deps : dep_t list) =
|
|
56 |
let fprintf_dependencies arrow_suffix fmt deps =
|
|
57 | 57 |
(* eprintf "Deps: %a@." pp_deps dep; *) |
58 | 58 |
let compiled_deps = compiled_dependencies deps in |
59 | 59 |
|
... | ... | |
63 | 63 |
Log.report ~level:1 (fun fmt -> fprintf fmt "Adding dependency: %s@." s); |
64 | 64 |
fprintf fmt "\t${GCC} -I${INC} -c %s@." s) |
65 | 65 |
("${INC}/io_frontend.c" |
66 |
:: sprintf "${INC}/arrow%s.c" arrow_suffix |
|
66 | 67 |
:: (* IO functions when a main function is computed *) |
67 | 68 |
List.map |
68 | 69 |
(fun dep -> |
... | ... | |
74 | 75 |
module type MODIFIERS_MKF = sig |
75 | 76 |
(* dep was (bool * ident * top_decl list) *) |
76 | 77 |
val other_targets : formatter -> string -> string -> dep_t list -> unit |
78 |
val pp_print_dependencies: formatter -> dep_t list -> unit |
|
79 |
val pp_arrow_o: formatter -> unit -> unit |
|
77 | 80 |
end |
78 | 81 |
|
79 | 82 |
module EmptyMod : MODIFIERS_MKF = struct |
80 | 83 |
let other_targets _ _ _ _ = () |
84 |
let pp_print_dependencies = fprintf_dependencies "" |
|
85 |
let pp_arrow_o fmt () = pp_print_string fmt "arrow.o" |
|
81 | 86 |
end |
82 | 87 |
|
83 | 88 |
module Main = |
... | ... | |
127 | 132 |
basename; |
128 | 133 |
fprintf fmt "\t${GCC} -I${INC} -I. -c %s.c@." basename; |
129 | 134 |
fprintf fmt "\t${GCC} -I${INC} -I. -c %s_main.c@." basename; |
130 |
fprintf_dependencies fmt dependencies;
|
|
135 |
Mod.pp_print_dependencies fmt dependencies;
|
|
131 | 136 |
fprintf |
132 | 137 |
fmt |
133 |
"\t${GCC} -o ${BINNAME} io_frontend.o %a %s.o %s_main.o %a@." |
|
138 |
"\t${GCC} -o ${BINNAME} io_frontend.o %a %a %s.o %s_main.o %a@." |
|
139 |
Mod.pp_arrow_o () |
|
134 | 140 |
(pp_print_list (fun fmt dep -> fprintf fmt "%s.o" dep.name)) |
135 | 141 |
(compiled_dependencies dependencies) |
136 | 142 |
basename |
Also available in: Unified diff
fix tests procedure