2 print_string
"usage: ";
3 print_string
(Filename.basename
Sys.executable_name
);
4 print_endline
" command [ command-argument ] [ arguments ... ]";
5 print_endline
"command is one of: ";
6 List.iter
(fun s
-> print_string
" "; print_endline s
)
8 " run `cl [arguments]' sanitizing output (converting pathes etc)";
12 " run `cl /E [arguments]'";
13 " search output for headers";
14 " print `target: <list-of-headers>' to standard output";
18 " run `cl /showIncludes /Zs [arguments]'";
23 " test if cl is new enough and has /showIncludes option";
26 "cldep7 target depfile";
27 " run `cl /showIncludes [arguments]'";
28 " same as cl+dep7 but put the dependency information into file <depfile>";
33 " run `link [arguments]'";
37 " show this help screen";
40 let exp_cmd, run_cmd
=
43 "C:\\> set ", "C:\\> "
47 List.iter print_endline
48 ["If environment variable IMT_[CL|LINK] is set it will be used as the ";
49 "path to respective utility, otherwise [cl.exe|link.exe] will be used";
51 "Headers produced by [cl]dep[7] commands will be tested against IMT_REJ";
52 "environment variable (: separated list of OCaml style regular expressions)";
53 "if the path to header matches it will be excluded from the printout";
54 "(pathes are tested after windows to unix translation (nop on Win platforms))";
57 exp_cmd ^
"IMT_REJ=/mnt/windows/msc/include:/mnt/psdk/include";
58 exp_cmd ^
"IMT_CL=/mnt/windows/msc/bin/cl.exe";
59 run_cmd ^
"imt cldep7 moo.obj moo.dep -c moo.c";
62 print_endline
"Have a nice day";
66 print_endline
"Incredible Mega Thing by extremely cool hacker, Version 0.94";
68 print_string
"usage: ";
69 print_string
(Filename.basename
Sys.executable_name
);
70 print_endline
" command [ command-argument ] [ arguments ... ]";
71 print_endline
"command is one of: ";
72 List.iter
(fun s
-> print_string
" "; print_endline s
)
74 "dep target: invoke cl /E, parse output, print dependencies to stdout";
75 "dep7 target: invoke cl /showIncludes /Zs, same as dep";
76 "dep7-test: test if /showIncludes is available, exit with non-zero if not";
77 "cldep7 target depfile: cl+dep7 combined, put dependencies into depfile";
79 "help: show extended help"
81 print_endline
"Have a nice day";
85 if Array.length argv
< 2
97 if Array.length argv
< 3
101 let target = argv
.(2) in
102 Dep7.invoke
target argv
3
105 if Array.length argv
< 3
109 let target = argv
.(2) in
110 Dep.invoke
target argv
3
119 if Array.length argv
< 4
123 let target = argv
.(2)
124 and depfile
= argv
.(3) in
125 Dep7.invoke2
target depfile argv
4
131 prerr_string
"invalid command: ";
132 prerr_string
(String.escaped cmd
);