-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile.tryocaml
111 lines (94 loc) · 2.33 KB
/
Makefile.tryocaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
all: byte $(TRYOCAML_NAME).js
SOURCES= lessons.ml lessons.mli
TARGETS=$(TRYOCAML_NAME).byte $(TRYOCAML_NAME).js
include $(ROOT)/Makefile.config
all: lessons.ml byte
clean:
rm -f *~ $(SOURCES) $(TRYOCAML_NAME).tmp $(TRYOCAML_NAME).js
ocp-build clean
lessons.mli: $(TUTORIAL_DIR)/lessons.mli
cp -f $(TUTORIAL_DIR)/lessons.mli lessons.mli
lessons.ml: $(LESSON_SET)/goodies.ml
../_obuild/try-make-lessons/try-make-lessons.byte $(LESSON_SET) > lessons.ml
CMOS= $(SOURCES:.ml=.cmo)
############### TRYOCAML_NAME=toplevel
# remove this variable to use the default ocaml toplevel
include $(ROOT)/toplevellib/toplevellib-$(OCAMLVNUM)/Makefile.config
COMP=$(JS_COMP)
JSFILES=$(JS_DIR)/runtime.js $(TOPLEVEL_DIR)/toplevel_runtime.js $(JS_DIR)/weak.js
#OCAMLC=ocamlfind ocamlc -annot -pp "camlp4o $(JS_DIR)/lib/syntax/pa_js.cmo"
EXPUNGE=$(shell ocamlc -where)/expunge
# Removed gc and sys
STDLIB_MODULES=\
arg \
array \
arrayLabels \
buffer \
callback \
camlinternalLazy \
camlinternalMod \
camlinternalOO \
char \
complex \
digest \
filename \
format \
genlex \
hashtbl \
int32 \
int64 \
lazy \
lexing \
list \
listLabels \
map \
marshal \
moreLabels \
nativeint \
obj \
oo \
parsing \
pervasives \
printexc \
printf \
queue \
random \
scanf \
set \
sort \
stack \
stdLabels \
stream \
string \
stringLabels \
weak
TOPLEVEL_MODULES=$(STDLIB_MODULES) n regexp tutorial outcometree topdirs toploop toplevel clflags n big_int num topnum lwt
TOPLEVEL_CMIS=$(TOPLEVEL_INCDIR)/toplevel.cmi
INCLUDES= \
-I $(LWT_DIR) \
-I $(CMICOMP_DIR) \
-I $(JS_COMPILER_LIB) \
-I $(JS_DIR) \
-I $(TUTORIAL_INCDIR)/ \
$(INCLUDE_TOPLEVELLIB) \
-I $(OCAMLNUM_INCDIR) \
-I $(TOPLEVEL_INCDIR) \
-I $(OCPJSLIB_INCDIR) \
$(TRYOCAML_EXTRA_INCLUDES) \
-I $(TOPLEVELLIB_DIR)/ \
-I .
ALWAYS:
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte: ALWAYS $(SOURCES)
ocp-build $(TRYOCAML_NAME)
$(TRYOCAML_NAME).js: \
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte \
$(JSFILES)
$(EXPUNGE) \
../_obuild/$(TRYOCAML_NAME)/$(TRYOCAML_NAME).byte \
$(TRYOCAML_NAME).tmp \
$(TOPLEVEL_MODULES) $(TRYOCAML_EXTRA_MODULES)
$(COMP) $(INCLUDES) \
-toplevel -linkall -noinline -noruntime \
$(JSFILES) $(TRYOCAML_NAME).tmp $(OPTIONS)
# @rm -f $(TRYOCAML_NAME).tmp
byte: $(TRYOCAML_NAME).js