0.90
[imt.git] / driver.ml
blob13b4fe04e81938ab4417810b55062cc9e3cd1738
1 let main argv =
2 let show_usage () =
3 print_endline "Incredible Mega Thing Version 0.90";
4 print_endline "Copryight (C) 2005 extremely cool hacker. All rights reserved.";
5 print_newline ();
6 print_string "usage: ";
7 print_string (Filename.basename Sys.executable_name);
8 print_endline " command [ command-argument ] [ arguments ... ]";
9 List.iter print_endline
10 ["command is one of: ";
11 "\tcl : invoke cl.exe";
12 "\tdep target : analyze cl.exe /E output, make dependencies";
13 "\tdep7 target : analyze cl.exe /showIncludes output, make dependencies";
14 "\tdep7-test : test weather dep7 is available";
15 "\tlink : invoke link.exe";
16 ""];
17 print_endline "Have a nice day";
18 exit 100
21 if Array.length argv < 2
22 then
23 show_usage ()
24 else
25 begin
26 Drive.init ();
27 let code =
28 match argv.(1) with
29 | "cl" ->
30 Cl.invoke argv 2
32 | "dep7" ->
33 if Array.length argv < 3
34 then
35 show_usage ()
36 else
37 let target = argv.(2) in
38 Dep7.invoke target argv 3
40 | "dep" ->
41 if Array.length argv < 3
42 then
43 show_usage ()
44 else
45 let target = argv.(2) in
46 Dep.invoke target argv 3
48 | "link" ->
49 Link.invoke argv 2
51 | "dep7-test" ->
52 Dep7.test ()
54 | cmd ->
55 prerr_string "invalid command: ";
56 prerr_string (String.escaped cmd);
57 prerr_newline ();
58 show_usage ()
60 exit code
61 end
63 let _ =
64 main Sys.argv