summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Norton2018-05-23 16:15:07 +0100
committerRobert Norton2018-05-23 16:15:07 +0100
commit28256ae0215b4fd1fefebf24f6b5dd3516fa8fcf (patch)
treecf19ffc135b86fc7e4228111c877e38e0973e236
parent0c583ea8feec9bc2aed441a976449974ff9350cc (diff)
Fix riscv build for older versions of ocamlbuild (e.g. 4.02.3) by copying platform ocaml files into _sbuild directory generated by sail and then running ocamlbuild there.
-rw-r--r--riscv/Makefile12
-rw-r--r--riscv/_tags1
2 files changed, 7 insertions, 6 deletions
diff --git a/riscv/Makefile b/riscv/Makefile
index 4bdbb71a..8d9c3d6d 100644
--- a/riscv/Makefile
+++ b/riscv/Makefile
@@ -1,20 +1,22 @@
SAIL_SRCS = prelude.sail riscv_types.sail riscv_sys.sail riscv_platform.sail riscv_mem.sail riscv_vmem.sail riscv.sail riscv_step.sail
+PLATFORM_OCAML_SRCS = platform.ml platform_impl.ml platform_main.ml
SAIL_DIR ?= $(realpath ..)
export SAIL_DIR
-all: riscv.ml platform Riscv.thy
+all: platform Riscv.thy
check: $(SAIL_SRCS) main.sail Makefile
$(SAIL_DIR)/sail $(SAIL_SRCS) main.sail
-riscv.ml: $(SAIL_SRCS) Makefile main.sail
+_sbuild/riscv.ml: $(SAIL_SRCS) Makefile main.sail
$(SAIL_DIR)/sail -ocaml -ocaml-nobuild -o riscv $(SAIL_SRCS)
-platform_main.native: riscv.ml platform.ml platform_main.ml Makefile _tags
- ocamlbuild -use-ocamlfind $@
+_sbuild/platform_main.native: _sbuild/riscv.ml _tags $(PLATFORM_OCAML_SRCS) Makefile
+ cp _tags $(PLATFORM_OCAML_SRCS) _sbuild
+ cd _sbuild && ocamlbuild -use-ocamlfind platform_main.native
-platform: platform_main.native
+platform: _sbuild/platform_main.native
rm -f $@ && ln -s $^ $@
riscv_duopod_ocaml: prelude.sail riscv_duopod.sail
diff --git a/riscv/_tags b/riscv/_tags
index 56fa3731..eab7e89a 100644
--- a/riscv/_tags
+++ b/riscv/_tags
@@ -1,4 +1,3 @@
<**/*.ml>: bin_annot, annot
-"_sbuild": include
<*.m{l,li}>: package(lem), package(linksem), package(zarith)
<platform_main.native>: package(lem), package(linksem), package(zarith)