Split oboy.ml
This commit is contained in:
parent
fe2c5e8ba1
commit
a206b9d7ca
4
Makefile
4
Makefile
|
@ -4,8 +4,8 @@ BUILD:=_build
|
||||||
# dune build src/core/oboy.exe
|
# dune build src/core/oboy.exe
|
||||||
|
|
||||||
core:
|
core:
|
||||||
dune build src/core/oboy.so
|
dune build src/core/cbindings.exe.o
|
||||||
cp _build/default/src/core/oboy.so $(BUILD)/liboboycore.so
|
ar -rs $(BUILD)/liboboycore.a _build/default/src/core/cbindings.exe.o
|
||||||
|
|
||||||
# check:
|
# check:
|
||||||
# ocamlbuild -use-ocamlfind -I src -lflag -g test/test_bit.byte --
|
# ocamlbuild -use-ocamlfind -I src -lflag -g test/test_bit.byte --
|
||||||
|
|
3
src/core/cbindings.ml
Normal file
3
src/core/cbindings.ml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
let () =
|
||||||
|
Callback.register "name" Version.name;
|
||||||
|
Callback.register "version" Version.version;
|
|
@ -1,7 +1,12 @@
|
||||||
; oboy.ml as the top-level file
|
; cbindings.ml as the top-level file
|
||||||
; building a shared library because we are relying on pthread and we cannot
|
; building a shared library because we are relying on pthread and we cannot
|
||||||
; combine static pthread with dynamic libc
|
; combine static pthread with dynamic libc
|
||||||
(executable
|
(executable
|
||||||
(name oboy)
|
(name cbindings)
|
||||||
(libraries threads)
|
(modes object))
|
||||||
(modes shared_object))
|
|
||||||
|
; Standalone binary
|
||||||
|
; TODO: split with core module
|
||||||
|
;(executable
|
||||||
|
; (name main.ml)
|
||||||
|
; (libraries threads))
|
||||||
|
|
|
@ -60,7 +60,7 @@ let power_up cartridge =
|
||||||
run cpu mem screen
|
run cpu mem screen
|
||||||
|
|
||||||
|
|
||||||
(** let main =
|
let () =
|
||||||
if Array.length Sys.argv < 2 then begin
|
if Array.length Sys.argv < 2 then begin
|
||||||
prerr_endline "Please specify a ROM.";
|
prerr_endline "Please specify a ROM.";
|
||||||
eprintf "Usage: %s path/to/rom\n" Sys.argv.(0);
|
eprintf "Usage: %s path/to/rom\n" Sys.argv.(0);
|
||||||
|
@ -70,8 +70,4 @@ let power_up cartridge =
|
||||||
let cartridge = Cartridge.read_cartridge Sys.argv.(1) in
|
let cartridge = Cartridge.read_cartridge Sys.argv.(1) in
|
||||||
match cartridge with
|
match cartridge with
|
||||||
| None -> print_endline "Invalid ROM file."
|
| None -> print_endline "Invalid ROM file."
|
||||||
| Some c -> power_up c *)
|
| Some c -> power_up c
|
||||||
|
|
||||||
let () =
|
|
||||||
Callback.register "name" Version.name;
|
|
||||||
Callback.register "version" Version.version;
|
|
Loading…
Reference in a new issue