Project

General

Profile

Revision 3b2bd83d src/backends/C/c_backend_makefile.ml

View differences:

src/backends/C/c_backend_makefile.ml
18 18
    (fun top -> 
19 19
      match top.top_decl_desc with
20 20
      | Const _ -> true 
21
      | ImportedNode nd -> nd.nodei_in_lib = None
21
      | ImportedNode nd -> nd.nodei_in_lib = []
22 22
      | _ -> false
23 23
    )
24 24
    header
......
26 26
let header_libs header =
27 27
  List.fold_left (fun accu top ->
28 28
    match top.top_decl_desc with
29
      | ImportedNode nd -> (match nd.nodei_in_lib with 
30
	| None -> accu 
31
	| Some lib -> Utils.list_union [lib] accu)
29
      | ImportedNode nd -> Utils.list_union nd.nodei_in_lib accu
32 30
      | _ -> accu 
33 31
  ) [] header 
34 32
    
......
72 70
  fprintf fmt "@.";
73 71

  
74 72
  (* Main binary *)
75
  fprintf fmt "%s_%s:@." basename nodename;
76
  fprintf fmt "\t${GCC} -I${INC} -I. -c %s.c@." basename;  
77
  fprintf fmt "\t${GCC} -I${INC} -I. -c %s_main.c@." basename;   
73
  fprintf fmt "%s_%s: %s.c %s_main.c@." basename nodename basename basename;
74
  fprintf fmt "\t${GCC} -O0 -I${INC} -I. -c %s.c@." basename;  
75
  fprintf fmt "\t${GCC} -O0 -I${INC} -I. -c %s_main.c@." basename;   
78 76
  fprintf_dependencies fmt dependencies;    
79
  fprintf fmt "\t${GCC} -o %s_%s io_frontend.o %a %s.o %s_main.o %a@." basename nodename 
77
  fprintf fmt "\t${GCC} -O0 -o %s_%s io_frontend.o %a %s.o %s_main.o %a@." basename nodename 
80 78
    (Utils.fprintf_list ~sep:" " (fun fmt (Dep (_, s, _, _)) -> Format.fprintf fmt "%s.o" s)) 
81 79
    (compiled_dependencies dependencies)
82 80
    basename (* library .o *)
......
87 85
 fprintf fmt "clean:@.";
88 86
 fprintf fmt "\t\\rm -f *.o %s_%s@." basename nodename;
89 87
 fprintf fmt "@.";
88
 fprintf fmt ".PHONY: %s_%s@." basename nodename;
89
 fprintf fmt "@.";
90 90
 Mod.other_targets fmt basename nodename dependencies;
91 91
 fprintf fmt "@.";
92 92

  

Also available in: Unified diff