Project

General

Profile

Revision 70e1006b src/backends/C/c_backend.ml

View differences:

src/backends/C/c_backend.ml
13 13
(********************************************************************************************)
14 14
(*                         Translation function                                             *)
15 15
(********************************************************************************************)
16

  
16
(* USELESS
17 17
let makefile_opt print basename dependencies makefile_fmt machines =
18 18
  (* If a main node is identified, generate a main target for it *)
19 19
  match !Options.main_node with
......
23 23
    | None -> Format.eprintf "Unable to find a main node named %s@.@?" main_node; ()
24 24
    | Some _ -> print basename !Options.main_node dependencies makefile_fmt
25 25
  )
26

  
26
*)
27 27

  
28 28
let gen_files funs basename prog machines dependencies header_file source_lib_file source_main_file makefile_file machines =
29 29
  let header_out = open_out header_file in
......
33 33
  
34 34
  let print_header, print_lib_c, print_main_c, print_makefile = funs in
35 35
  (* Generating H file *)
36
  print_header header_fmt basename prog machines;
36
  print_header header_fmt basename prog machines dependencies;
37 37
  
38 38
  (* Generating Lib C file *)
39 39
  print_lib_c source_lib_fmt basename prog machines dependencies;
40 40

  
41
  close_out header_out;
42
  close_out source_lib_out;
43

  
41 44
  match !Options.main_node with
42 45
  | "" ->  () (* No main node: we do not genenrate main nor makefile *)
43 46
  | main_node -> (
......
53 56
      print_main_c source_main_fmt m basename prog machines dependencies;
54 57
      
55 58
      (* Generating Makefile *)
56
     print_makefile basename main_node dependencies makefile_fmt
59
     print_makefile basename main_node dependencies makefile_fmt;
60

  
61
     close_out source_main_out;
62
     close_out makefile_out
63

  
57 64
    end
58 65
  )
59
    
60

  
61 66

  
62 67
let translate_to_c header source_lib source_main makefile basename prog machines dependencies =
63 68

  
......
73 78
    let module SourceMain = C_backend_main.Main (SourceMainMod) in
74 79
    let module Makefile = C_backend_makefile.Main (MakefileMod) in
75 80
        
76
    let funs = Header.print_header, Source.print_lib_c, SourceMain.print_main_c, Makefile.print_makefile in
81
    let funs = Header.print_alloc_header, Source.print_lib_c, SourceMain.print_main_c, Makefile.print_makefile in
77 82
    gen_files funs basename prog machines dependencies header source_lib source_main makefile machines
78 83

  
79 84
  end
......
89 94
    let module SourceMain = C_backend_main.Main (SourceMainMod) in
90 95
    let module Makefile = C_backend_makefile.Main (MakefileMod) in
91 96
        
92
    let funs = Header.print_header, Source.print_lib_c, SourceMain.print_main_c, Makefile.print_makefile in
97
    let funs = Header.print_alloc_header, Source.print_lib_c, SourceMain.print_main_c, Makefile.print_makefile in
93 98
    gen_files funs basename prog machines dependencies header source_lib source_main makefile machines
94 99

  
95 100
  end

Also available in: Unified diff