8 Printf.sprintf "-D%s=%s" x y)
14 (fun {scm = {scm_cmd=scm_cmd; includes=includes; link_std=link_std}} input output ->
15 [Printf.sprintf "%s -c -I %s -o %s %s %s"
16 scm_cmd includes output
17 (if link_std then "std.ho" else "")
19 many_to_one ["scm"] "abc"
20 (fun {scm = {scm_cmd=scm_cmd; includes=includes;link_std=link_std}} inputs output ->
21 [Printf.sprintf "%s -I %s -o %s %s %s"
22 scm_cmd includes output
23 (if link_std then "std.ho" else "")
24 @@ String.concat " " inputs ]);
25 many_to_one ["scm";"ho"] "abc"
26 (fun {scm = {scm_cmd=scm_cmd; includes=includes}} inputs output ->
27 [Printf.sprintf "%s -I %s -o %s %s"
28 scm_cmd includes output @@ String.concat " " inputs ]);
29 many_to_one ["ho"] "abc"
30 (fun {scm = {scm_cmd=scm_cmd; includes=includes}} inputs output ->
31 [Printf.sprintf "%s -I %s -o %s %s"
32 scm_cmd includes output @@ String.concat " " inputs ]);
33 one_to_one "abc" "abcx"
34 (fun {abc = {abc_cmd=abc_cmd}} input output ->
35 [Printf.sprintf "%s %s > %s" abc_cmd input output]);
36 one_to_one "abcx" "swfx"
41 bg_color = {Color.red=r; green=g; blue=b};
43 [Printf.sprintf "%s -I. %s %s > %s"
47 "__MAIN_CLASS__","boot.Boot";
48 "__WIDTH__" ,string_of_int w;
49 "__HEIGHT__" ,string_of_int h;
50 "__BG_RED__" ,string_of_int r;
51 "__BG_GREEN__" ,string_of_int g;
52 "__BG_BLUE__" ,string_of_int b;
55 one_to_one "swfx" "swf"
56 (fun { swfx = { swfx_cmd=swfx_cmd } } input output ->
57 [Printf.sprintf "%s xml2swf %s %s" swfx_cmd input output]);
60 let debug verbose str =
62 Printf.eprintf "--> %s\n" str;
66 let system {general={verbose=verbose}} cmd =
68 Str.global_replace (Str.regexp "\\\\") "/" cmd in
72 let execute _ commands =
78 | Unix.WEXITED n | WSIGNALED n | WSTOPPED n ->
79 prerr_endline "BUILD ERROR";
83 let verbose {general={verbose=verbose}} s =
88 let {inputs=inputs; output=output} as ctx =
91 verbose ctx @@ Printf.sprintf "Target: [%s] => %s\n" (String.concat "; " inputs) output in
93 Rule.commands ctx rules inputs output in
94 if ctx.general.just_print then
95 List.iter print_endline commands
98 if not ctx.general.keep_files then
99 List.iter Sys.remove @@ Rule.temp_files ctx rules inputs output
103 if not !Sys.interactive then