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

Commit b39fe0e

Browse files
author
Çagdas Bozman
committed
Merge branch 'without_js_of_ocaml'
Conflicts: ocaml-lessons/lesson5/step5/step.html
2 parents 6333560 + c689a46 commit b39fe0e

File tree

184 files changed

+1132
-25137
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

184 files changed

+1132
-25137
lines changed

.depend

Whitespace-only changes.

.gitignore

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ tutorial/lessons.ml
1818
tutorial/make_lessons
1919
*.byte
2020
#*#
21-
js_of_ocaml/compiler/js_of_ocaml
22-
js_of_ocaml/lib/deriving_json/deriving_Json_lexer.ml
23-
js_of_ocaml/lib/log
24-
js_of_ocaml/lib/stubs.c
25-
js_of_ocaml/runtime/runtime.js
2621
try-ocaml/lessons.ml
2722
try-ocaml/lessons.mli
2823
try-ocaml/try-ocaml.js
@@ -32,3 +27,5 @@ try-js_of_ocaml/lessons.mli
3227
try-js_of_ocaml/try-js_of_ocaml.js
3328
try-js_of_ocaml/try-ocaml.js
3429
Makefile.config
30+
ocp-build.root*
31+
_obuild

Makefile

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11

22

33
all: Makefile.config
4-
$(MAKE) -C js_of_ocaml
5-
$(MAKE) -C js_of_ocaml/compiler compiler.cma
64
$(MAKE) -C cmicomp
7-
$(MAKE) -C ocp-jslib
8-
$(MAKE) -C ocaml-num
9-
$(MAKE) -C toplevel
10-
$(MAKE) -C tutorial
5+
ocp-build build try-make-lessons
116
$(MAKE) -C try-ocaml
127
$(MAKE) -C try-js_of_ocaml
138

@@ -16,27 +11,9 @@ Makefile.config:
1611

1712
clean:
1813
$(MAKE) -C cmicomp clean
19-
$(MAKE) -C ocp-jslib clean
20-
$(MAKE) -C toplevel clean
21-
$(MAKE) -C ocaml-num clean
22-
$(MAKE) -C toplevel clean
23-
$(MAKE) -C tutorial clean
2414
$(MAKE) -C try-ocaml clean
2515
$(MAKE) -C try-js_of_ocaml clean
2616

27-
cleanall: clean
28-
$(MAKE) -C js_of_ocaml clean
29-
30-
depend:
31-
$(MAKE) -C js_of_ocaml depend
32-
$(MAKE) -C cmicomp depend
33-
$(MAKE) -C ocp-jslib depend
34-
$(MAKE) -C toplevel depend
35-
$(MAKE) -C ocaml-num depend
36-
$(MAKE) -C tutorial depend
37-
$(MAKE) -C try-ocaml depend
38-
$(MAKE) -C try-js_of_ocaml depend
39-
4017
update-lessons:
4118
touch ocaml-lessons/goodies.ml
4219
$(MAKE) -C try-ocaml

Makefile.jsconfig

Lines changed: 0 additions & 3 deletions
This file was deleted.

Makefile.rules

Lines changed: 0 additions & 14 deletions
This file was deleted.

Makefile.tryocaml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
all: byte $(TRYOCAML_NAME).js
22

3-
include $(ROOT)/Makefile.jsconfig
4-
53
SOURCES= lessons.ml lessons.mli
64
TARGETS=$(TRYOCAML_NAME).byte $(TRYOCAML_NAME).js
75

86
include $(ROOT)/Makefile.config
97

108
all: lessons.ml byte
119

10+
clean:
11+
rm -f *~ $(SOURCES) $(TRYOCAML_NAME).tmp $(TRYOCAML_NAME).js
12+
ocp-build clean
13+
1214
lessons.mli: $(TUTORIAL_DIR)/lessons.mli
1315
cp -f $(TUTORIAL_DIR)/lessons.mli lessons.mli
14-
lessons.ml: lessons.cmi $(LESSON_SET)/goodies.ml
15-
$(TUTORIAL_DIR)/make_lessons $(LESSON_SET) > lessons.ml
16+
lessons.ml: $(LESSON_SET)/goodies.ml
17+
../_obuild/try-make-lessons/try-make-lessons.byte $(LESSON_SET) > lessons.ml
1618

1719
CMOS= $(SOURCES:.ml=.cmo)
1820

1921
############### TRYOCAML_NAME=toplevel
2022
# remove this variable to use the default ocaml toplevel
21-
include $(ROOT)/toplevellib-$(OCAMLVNUM)/Makefile.config
23+
include $(ROOT)/toplevellib/toplevellib-$(OCAMLVNUM)/Makefile.config
2224

2325

24-
COMP=$(JS_DIR)/compiler/js_of_ocaml
25-
JSFILES=$(JS_DIR)/runtime/runtime.js $(JS_DIR)/runtime/weak.js $(TOPLEVEL_DIR)/toplevel_runtime.js
26+
COMP=$(JS_COMP)
27+
JSFILES=$(JS_DIR)/runtime.js $(TOPLEVEL_DIR)/toplevel_runtime.js
2628
#OCAMLC=ocamlfind ocamlc -annot -pp "camlp4o $(JS_DIR)/lib/syntax/pa_js.cmo"
2729
EXPUNGE=$(shell ocamlc -where)/expunge
2830
# Removed gc and sys
@@ -70,41 +72,39 @@ STDLIB_MODULES=\
7072
stringLabels \
7173
weak
7274

73-
TOPLEVEL_MODULES=$(STDLIB_MODULES) n regexp tutorial outcometree topdirs toploop toplevel clflags n big_int num topnum
75+
TOPLEVEL_MODULES=$(STDLIB_MODULES) n regexp tutorial outcometree topdirs toploop toplevel clflags n big_int num topnum lwt
7476

75-
TOPLEVEL_CMIS=$(TOPLEVEL_DIR)/toplevel.cmi
76-
TOPLEVEL_CMAS= \
77-
$(CMICOMP_DIR)/js_of_ocaml.cma $(JS_DIR)/compiler/compiler.cma \
78-
$(TOPLEVELLIB_CMAS) \
79-
$(OCAMLNUM_DIR)/ocaml-num.cma \
80-
lessons.cmo \
81-
$(TUTORIAL_DIR)/tutorial.cma \
82-
$(OCPJSLIB_DIR)/ocp-jslib.cma
83-
TOPLEVEL_CMOS=$(TOPLEVEL_DIR)/toplevel.cmo \
84-
$(TOPLEVEL_DIR)/topmain.cmo main.cmo
77+
TOPLEVEL_CMIS=$(TOPLEVEL_INCDIR)/toplevel.cmi
8578

8679
INCLUDES= \
80+
-I $(LWT_DIR) \
8781
-I $(CMICOMP_DIR) \
88-
-I $(JS_DIR)/compiler \
89-
-I $(JS_DIR)/lib \
90-
-I $(TUTORIAL_DIR)/ \
82+
-I $(JS_COMPILER_LIB) \
83+
-I $(JS_DIR) \
84+
-I $(TUTORIAL_INCDIR)/ \
9185
$(INCLUDE_TOPLEVELLIB) \
92-
-I $(OCAMLNUM_DIR) \
93-
-I $(TOPLEVEL_DIR) \
94-
-I $(OCPJSLIB_DIR) \
86+
-I $(OCAMLNUM_INCDIR) \
87+
-I $(TOPLEVEL_INCDIR) \
88+
-I $(OCPJSLIB_INCDIR) \
9589
$(TRYOCAML_EXTRA_INCLUDES) \
9690
-I .
9791

98-
$(TRYOCAML_NAME).js: $(TRYOCAML_NAME).byte $(JSFILES)
99-
$(COMP) $(INCLUDES) -toplevel -noinline -noruntime $(JSFILES) $(TRYOCAML_NAME).byte $(OPTIONS)
92+
ALWAYS:
93+
94+
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte: ALWAYS $(SOURCES)
95+
ocp-build $(TRYOCAML_NAME)
10096

101-
$(TRYOCAML_NAME).byte: $(TOPLEVEL_CMIS) $(TOPLEVEL_CMOS) $(TOPLEVEL_CMAS) \
102-
$(TRYOCAML_EXTRA_CMAS) $(TRYOCAML_EXTRA_CMIS)
103-
$(OCAMLFIND) $(OCAMLC) $(INCLUDES) -linkall $(OCAMLFIND_OPTIONS) -package str -linkpkg \
104-
-o [email protected] $(TOPLEVEL_CMAS) \
105-
$(TRYOCAML_EXTRA_CMAS) $(TRYOCAML_EXTRA_CMOS) $(TOPLEVEL_CMOS)
106-
$(EXPUNGE) [email protected] $@ $(TOPLEVEL_MODULES) $(TRYOCAML_EXTRA_MODULES)
107-
97+
$(TRYOCAML_NAME).js: \
98+
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte \
99+
$(JSFILES)
100+
$(EXPUNGE) \
101+
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte \
102+
$(TRYOCAML_NAME).tmp \
103+
$(TOPLEVEL_MODULES) $(TRYOCAML_EXTRA_MODULES)
104+
$(COMP) $(INCLUDES) \
105+
-toplevel -linkall -noinline -noruntime \
106+
$(JSFILES) $(TRYOCAML_NAME).tmp $(OPTIONS)
107+
# @rm -f $(TRYOCAML_NAME).tmp
108108

109-
byte: lessons.cmo $(TRYOCAML_NAME).byte
109+
byte: $(TRYOCAML_NAME).js
110110

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ js_of_ocaml (see http://ocsigen.org/js_of_ocaml/).
1313

1414
* Findlib
1515
* Lwt (version 2.4.0** at least, see http://ocsigen.org/lwt/)
16+
* js_of_ocaml (development version)
1617

1718
# Try it
1819

cmicomp/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ CMICOMP=$(TOPLEVELLIB_DIR)/cmicomp
1515
all: $(CMICOMP) $(JS_CMIS)
1616

1717

18-
$(JS_CMIS): $(JS_DIR)/lib/*.cmi
19-
cp -f $(JS_DIR)/lib/*.cmi .
20-
cp -f $(JS_DIR)/lib/js_of_ocaml.cma .
18+
$(JS_CMIS): $(JS_DIR)/*.cmi
19+
cp -f $(JS_DIR)/*.cmi .
20+
cp -f $(JS_DIR)/js_of_ocaml.cma .
2121
ocamlrun $(CMICOMP) $(CMICOMP_FLAGS) $(JS_CMIS)
2222

2323
clean:

configure

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
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=$(ROOT)/js_of_ocaml' >> 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
12+
echo JS_COMP=`which js_of_ocaml` >> Makefile.config.temp
13+
echo JS_COMPILER_LIB=`ocp-build query -libdir js_of_ocaml_compiler` >> Makefile.config.temp
814
echo 'TOPLEVEL_DIR=$(ROOT)/toplevel' >> Makefile.config.temp
9-
echo 'OCAMLNUM_DIR=$(ROOT)/ocaml-num' >> Makefile.config.temp
15+
echo 'TOPLEVEL_INCDIR=$(ROOT)/_obuild/try-toplevel' >> Makefile.config.temp
16+
echo 'OCAMLNUM_INCDIR=$(ROOT)/_obuild/ocaml-num' >> Makefile.config.temp
17+
echo 'TUTORIAL_INCDIR=$(ROOT)/_obuild/try-tutorial' >> Makefile.config.temp
1018
echo 'TUTORIAL_DIR=$(ROOT)/tutorial' >> Makefile.config.temp
11-
echo 'TOPLEVELLIB_DIR=$(ROOT)/toplevellib-$(OCAMLVNUM)' >> Makefile.config.temp
19+
echo 'TOPLEVELLIB_DIR=$(ROOT)/toplevellib/toplevellib-$(OCAMLVNUM)' >> Makefile.config.temp
1220
echo 'CMICOMP_DIR=$(ROOT)/cmicomp' >> Makefile.config.temp
13-
echo 'OCPJSLIB_DIR=$(ROOT)/ocp-jslib' >> Makefile.config.temp
21+
echo 'OCPJSLIB_INCDIR=$(ROOT)/_obuild/ocp-jslib' >> Makefile.config.temp
1422
echo 'SCP=scp' >> Makefile.config.temp
1523

1624
mv Makefile.config.temp Makefile.config

js_of_ocaml/Makefile

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)