aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-06-20 22:57:00 +0100
committerGitHub <noreply@github.com>2024-06-20 22:57:00 +0100
commit40ed0c5b204e8e2f11031575975197053d6d354b (patch)
tree776ccfc059d00b207e40d2ef68da89c87ecd44f7
parent157d4d14d0cf7016efc0023d499c6fdc1c22deaa (diff)
downloadsail-riscv-40ed0c5b204e8e2f11031575975197053d6d354b.zip
sail-riscv-40ed0c5b204e8e2f11031575975197053d6d354b.tar.gz
sail-riscv-40ed0c5b204e8e2f11031575975197053d6d354b.tar.bz2
Fix consecutive builds of the OCaml emulator
These OCaml files can be read only, in which case copying them for a second build fails. To work around this use the `-f` flag which ignores the read-only-ness.
-rw-r--r--Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index d62c858..af355ef 100644
--- a/Makefile
+++ b/Makefile
@@ -226,14 +226,18 @@ generated_definitions/ocaml/$(ARCH)/riscv.ml: $(SAIL_SRCS) Makefile
mkdir -p generated_definitions/ocaml/$(ARCH)
$(SAIL) $(SAIL_FLAGS) -ocaml -ocaml-nobuild -ocaml_build_dir generated_definitions/ocaml/$(ARCH) -o riscv $(SAIL_SRCS)
+# cp -f is required because the generated_definitions/ocaml/$ARCH/*.ml files can
+# be read-only, which would otherwise make subsequent builds fail.
ocaml_emulator/_sbuild/riscv_ocaml_sim.native: generated_definitions/ocaml/$(ARCH)/riscv.ml ocaml_emulator/_tags $(PLATFORM_OCAML_SRCS) Makefile
mkdir -p ocaml_emulator/_sbuild
- cp ocaml_emulator/_tags $(PLATFORM_OCAML_SRCS) generated_definitions/ocaml/$(ARCH)/*.ml ocaml_emulator/_sbuild
+ cp ocaml_emulator/_tags $(PLATFORM_OCAML_SRCS) ocaml_emulator/_sbuild
+ cp -f generated_definitions/ocaml/$(ARCH)/*.ml ocaml_emulator/_sbuild
cd ocaml_emulator/_sbuild && ocamlbuild -use-ocamlfind riscv_ocaml_sim.native
ocaml_emulator/_sbuild/coverage.native: generated_definitions/ocaml/$(ARCH)/riscv.ml ocaml_emulator/_tags.bisect $(PLATFORM_OCAML_SRCS) Makefile
mkdir -p ocaml_emulator/_sbuild
- cp $(PLATFORM_OCAML_SRCS) generated_definitions/ocaml/$(ARCH)/*.ml ocaml_emulator/_sbuild
+ cp $(PLATFORM_OCAML_SRCS) ocaml_emulator/_sbuild
+ cp -f generated_definitions/ocaml/$(ARCH)/*.ml ocaml_emulator/_sbuild
cp ocaml_emulator/_tags.bisect ocaml_emulator/_sbuild/_tags
cd ocaml_emulator/_sbuild && ocamlbuild -use-ocamlfind riscv_ocaml_sim.native && cp -L riscv_ocaml_sim.native coverage.native