1 let start = Unix.gettimeofday
();;
8 let jobs, targets
, dodeplist
, dotarlist
= getopt
();;
11 match getval
"src" with
12 | None
-> failwith
"no source dir"
17 cmopp ~flags
:"-g -I +lablGL -thread" ~dirname
:srcdir "apc";
20 "-ccopt '-Wall -o ml_apc.o'"
22 (StrSet.singleton
"ml_apc.o")
23 [Filename.concat
srcdir "ml_apc.c"]
28 "-Wall -Werror -g -c" ""
30 [Filename.concat
srcdir (base ^
".c")]
42 "-custom -thread -g -I +lablGL lablgl.cma lablglut.cma unix.cma threads.cma"
44 (StrSet.singleton
"apc")
45 ["ml_apc.o"; "apc.cmo"]
49 let moddir = Filename.concat
srcdir "mod" in
50 let modconts = Sys.readdir
moddir in
51 let deps = Array.fold_left
(fun deps s
->
52 if String.length s
> 0 && s
.[0] != '
.'
54 let src = Filename.concat
moddir s
in
55 add_target s
(StrSet.singleton
src) (StrSet.singleton s
) (StrSet.singleton
src);
58 [Run
("cp " ^
Filename.quote
src ^
" " ^
Filename.quote s
)]
63 { get_commands
= commands
65 ; get_presentation
= presentation
68 State.put_build_info s
build;
72 ) StrSet.empty
modconts
75 let commands _ = [Run
("make")]
77 and presentation
_ = "KBUILD" in
78 { get_commands
= commands
80 ; get_presentation
= presentation
83 add_phony
"mod" deps "";
84 State.put_build_info
"mod" build;
90 Helpers.run
start jobs targets dodeplist dotarlist