Revision a7062da6
Added by LĂ©lio Brun over 3 years ago
src/backends/C/c_backend_makefile.ml | ||
---|---|---|
9 | 9 |
(* *) |
10 | 10 |
(********************************************************************) |
11 | 11 |
|
12 |
open Utils |
|
12 | 13 |
open Format |
13 | 14 |
open Lustre_types |
14 | 15 |
|
15 | 16 |
let pp_dep fmt dep = |
16 |
Format.fprintf fmt "%b, %s, {%a}, %b" dep.local dep.name Printers.pp_prog
|
|
17 |
fprintf fmt "%b, %s, {%a}, %b" dep.local dep.name Printers.pp_prog |
|
17 | 18 |
dep.content dep.is_stateful |
18 | 19 |
|
19 | 20 |
let pp_deps fmt deps = |
20 |
Format.fprintf fmt "@[<v 0>%a@ @]" (Utils.fprintf_list ~sep:"@ ," pp_dep) deps
|
|
21 |
fprintf fmt "@[<v 0>%a@ @]" (pp_comma_list pp_dep) deps
|
|
21 | 22 |
|
22 | 23 |
let header_has_code header = |
23 | 24 |
List.exists |
... | ... | |
50 | 51 |
[] deps |
51 | 52 |
|
52 | 53 |
let fprintf_dependencies fmt (deps : dep_t list) = |
53 |
(* Format.eprintf "Deps: %a@." pp_deps dep; *)
|
|
54 |
(* eprintf "Deps: %a@." pp_deps dep; *) |
|
54 | 55 |
let compiled_deps = compiled_dependencies deps in |
55 | 56 |
|
56 |
(* Format.eprintf "Compiled Deps: %a@." pp_deps compiled_dep; *)
|
|
57 |
(* eprintf "Compiled Deps: %a@." pp_deps compiled_dep; *) |
|
57 | 58 |
List.iter |
58 | 59 |
(fun s -> |
59 | 60 |
Log.report ~level:1 (fun fmt -> fprintf fmt "Adding dependency: %s@." s); |
... | ... | |
69 | 70 |
|
70 | 71 |
module type MODIFIERS_MKF = sig |
71 | 72 |
(* dep was (bool * ident * top_decl list) *) |
72 |
val other_targets : Format.formatter -> string -> string -> dep_t list -> unit
|
|
73 |
val other_targets : formatter -> string -> string -> dep_t list -> unit |
|
73 | 74 |
end |
74 | 75 |
|
75 | 76 |
module EmptyMod : MODIFIERS_MKF = struct |
... | ... | |
118 | 119 |
fprintf fmt "\t${GCC} -I${INC} -I. -c %s_main.c@." basename; |
119 | 120 |
fprintf_dependencies fmt dependencies; |
120 | 121 |
fprintf fmt "\t${GCC} -o ${BINNAME} io_frontend.o %a %s.o %s_main.o %a@." |
121 |
(Utils.fprintf_list ~sep:" " (fun fmt dep -> |
|
122 |
Format.fprintf fmt "%s.o" dep.name)) |
|
122 |
(pp_print_list (fun fmt dep -> fprintf fmt "%s.o" dep.name)) |
|
123 | 123 |
(compiled_dependencies dependencies) |
124 | 124 |
basename (* library .o *) basename |
125 | 125 |
(* main function . o *) |
126 |
(Utils.fprintf_list ~sep:" " (fun fmt lib -> fprintf fmt "-l%s" lib))
|
|
126 |
(pp_print_list (fun fmt lib -> fprintf fmt "-l%s" lib))
|
|
127 | 127 |
(lib_dependencies dependencies); |
128 | 128 |
fprintf fmt "@."; |
129 | 129 |
fprintf fmt "clean:@."; |
Also available in: Unified diff
another step towards refactoring