Split oboy.ml

master
Fabien Freling 4 years ago
parent fe2c5e8ba1
commit a206b9d7ca
  1. 4
      Makefile
  2. 3
      src/core/cbindings.ml
  3. 13
      src/core/dune
  4. 8
      src/core/main.ml

@ -4,8 +4,8 @@ BUILD:=_build
# dune build src/core/oboy.exe
core:
dune build src/core/oboy.so
cp _build/default/src/core/oboy.so $(BUILD)/liboboycore.so
dune build src/core/cbindings.exe.o
ar -rs $(BUILD)/liboboycore.a _build/default/src/core/cbindings.exe.o
# check:
# ocamlbuild -use-ocamlfind -I src -lflag -g test/test_bit.byte --

@ -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
; combine static pthread with dynamic libc
(executable
(name oboy)
(libraries threads)
(modes shared_object))
(name cbindings)
(modes 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
(** let main =
let () =
if Array.length Sys.argv < 2 then begin
prerr_endline "Please specify a ROM.";
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
match cartridge with
| None -> print_endline "Invalid ROM file."
| Some c -> power_up c *)
let () =
Callback.register "name" Version.name;
Callback.register "version" Version.version;
| Some c -> power_up c
Loading…
Cancel
Save