Ho | Abc | Abcx | Swfx | Swf
type scm = {
- scm_cmd: string;
- includes: string
+ scm_cmd: string;
+ includes: string;
+ link_std: bool
}
type abc = {
~metavar:"<dir ..>"
~short_name:'I'
~help:"Add <dir ..> to the list of include directories" () in
+ let no_std =
+ bool_option
+ ~default:true
+ ~long_name:"no_std"
+ ~help:"without std library" () in
let default =
Config.default_includes
+> List.filter Sys.file_exists
fun () -> {
scm_cmd = Opt.get cmd;
includes = default ^ Config.path_sep ^ Opt.get includes;
+ link_std = Opt.get no_std
}
let abc =
~help:"stage background color" () in
let main_class =
str_option
- ~default:"Main"
+ ~default:"main.Main"
~metavar:"<class>"
~long_name:"main_class"
- ~help:"Main Class of swf" () in
+ ~help:"Specify main Class of swf(e.g. main.Main)" () in
let template =
str_option
~default:Config.default_template
let rules = [
one_to_one "scm" "ho"
- (fun {scm = {scm_cmd=scm_cmd; includes=includes}} input output ->
- [Printf.sprintf "%s -c -I %s -o %s %s"
- scm_cmd includes output input ]);
+ (fun {scm = {scm_cmd=scm_cmd; includes=includes; link_std=link_std}} input output ->
+ [Printf.sprintf "%s -c -I %s -o %s %s %s"
+ scm_cmd includes output
+ (if link_std then "std.ho" else "")
+ input ]);
many_to_one ["scm"] "abc"
- (fun {scm = {scm_cmd=scm_cmd; includes=includes}} inputs output ->
- [Printf.sprintf "%s -I %s -o %s %s"
- scm_cmd includes output @@ String.concat " " inputs ]);
+ (fun {scm = {scm_cmd=scm_cmd; includes=includes;link_std=link_std}} inputs output ->
+ [Printf.sprintf "%s -I %s -o %s %s %s"
+ scm_cmd includes output
+ (if link_std then "std.ho" else "")
+ @@ String.concat " " inputs ]);
many_to_one ["scm";"ho"] "abc"
(fun {scm = {scm_cmd=scm_cmd; includes=includes}} inputs output ->
[Printf.sprintf "%s -I %s -o %s %s"
end
let system {general={verbose=verbose}} cmd =
- let cmd' =
+ let cmd' =
Str.global_replace (Str.regexp "\\\\") "/" cmd in
debug verbose cmd';
Unix.system cmd'
lib: $(LIBS)
%.ho : %.scm $(ROOT)/habc$(EXE) $(ROOT)/habc-scm$(EXE)
- $(ROOT)/habc$(EXE) --scm=$(absname $(ROOT)/habc-scm$(EXE)) -I . -c $<
+ $(ROOT)/habc$(EXE) --scm=$(absname $(ROOT)/habc-scm$(EXE)) --no_std -I . -c $<
clean:
ocaml-clean *.ho