Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 642634c

Browse files
committed
Update for 4.01 and new version of ocp-build
1 parent cc40e2f commit 642634c

16 files changed

+842
-16
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
all: Makefile.config
44
$(MAKE) -C cmicomp
5-
ocp-build -scan try-make-lessons
5+
ocp-build build try-make-lessons
66
$(MAKE) -C try-ocaml
77
$(MAKE) -C try-js_of_ocaml
88

Makefile.tryocaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ all: lessons.ml byte
99

1010
clean:
1111
rm -f *~ $(SOURCES) $(TRYOCAML_NAME).tmp $(TRYOCAML_NAME).js
12-
ocp-build -clean
12+
ocp-build clean
1313

1414
lessons.mli: $(TUTORIAL_DIR)/lessons.mli
1515
cp -f $(TUTORIAL_DIR)/lessons.mli lessons.mli

configure

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/bin/sh
22
echo Generating Makefile.config
33

4+
ocp-build init
5+
ocp-build configure
6+
47
echo OCAMLC=ocamlc > Makefile.config.temp
58
echo OCAMLDEP=ocamldep.opt >> Makefile.config.temp
6-
echo OCAMLVNUM=`ocamlc -version` >> Makefile.config.temp
7-
echo JS_DIR=`ocp-build -configure -query js_of_ocaml` >> Makefile.config.temp
8-
echo LWT_DIR=`ocp-build -configure -query lwt` >> Makefile.config.temp
9+
echo OCAMLVNUM=`ocamlc -version | cut -b 1-6` >> Makefile.config.temp
10+
echo JS_DIR=`ocp-build query -libdir js_of_ocaml` >> Makefile.config.temp
11+
echo LWT_DIR=`ocp-build query -libdir lwt` >> Makefile.config.temp
912
echo JS_COMP=`which js_of_ocaml` >> Makefile.config.temp
10-
echo JS_COMPILER_LIB=`ocp-build -configure -query js_of_ocaml_compiler` >> Makefile.config.temp
13+
echo JS_COMPILER_LIB=`ocp-build query -libdir js_of_ocaml_compiler` >> Makefile.config.temp
1114
echo 'TOPLEVEL_DIR=$(ROOT)/toplevel' >> Makefile.config.temp
1215
echo 'TOPLEVEL_INCDIR=$(ROOT)/_obuild/try-toplevel' >> Makefile.config.temp
1316
echo 'OCAMLNUM_INCDIR=$(ROOT)/_obuild/ocaml-num' >> Makefile.config.temp
@@ -20,5 +23,3 @@ echo 'SCP=scp' >> Makefile.config.temp
2023

2124
mv Makefile.config.temp Makefile.config
2225
echo Makefile.config generated
23-
24-
echo -n "" >> ocp-build.root

ocp-jslib/ocp-jslib.ocp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ begin
1111
requires = [ "camlp4lib" "camlp4-pa-op" "Camlp4Bin" ]
1212
end
1313
*)
14-
dirname = [ "/home/lefessan/.opam/4.00.1/lib/js_of_ocaml" ]
14+
dirname = [ "%{js_of_ocaml.syntax_SRC_DIR}%" ]
1515

1616
begin objects "js_of_ocaml.camlp4-syntax.objects"
1717
files = [ "pa_js.ml" ]

ocp-jslib/utils.ml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ let get_by_name id =
3030
Js.to_string div##innerHTML
3131

3232
let read_from_input ?msg:(msg="") ?default:(default="") =
33-
Js.to_string (window##prompt (_s msg, _s default))
33+
match Js.Opt.to_option (window##prompt (_s msg, _s default)) with
34+
None -> assert false
35+
| Some s -> Js.to_string s
3436

3537
let jsnew0 (constr : 'a Js.t Js.constr) () =
3638
(Js.Unsafe.new_obj constr [| |] : 'a Js.t)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
all:
2+
echo Use this Makefile to update this directory from a patched OCaml toplevel
3+
4+
update:
5+
cp `ocamlc -where`/compiler-libs/ocamlbytecomp.cma .
6+
cp `ocamlc -where`/compiler-libs/ocamlcommon.cma .
7+
cp `ocamlc -where`/compiler-libs/ocamltoplevel.cma .
8+
cp `ocamlc -where`/compiler-libs/topdirs.cmi .
9+
cp `ocamlc -where`/compiler-libs/toploop.cmi .
10+
cp `ocamlc -where`/compiler-libs/outcometree.cmi .
11+
cp `ocamlc -where`/compiler-libs/clflags.cmi .
4.95 KB
Binary file not shown.
463 KB
Binary file not shown.

0 commit comments

Comments
 (0)