@@ -20,7 +20,7 @@ lam_fold.ml: lambda_fold.mlp lambda.mlp
20
20
@echo " Regenrating lambda_map.ml"
21
21
$(CAMLP4OF ) -filter map -filter trash -impl $< -printer o > $@
22
22
23
- ./bin/bsc : _build/ext/ext.cmxa _build/common/common.cmxa _build/syntax/syntax.cmxa _build/core.cmxa
23
+ ./bin/bsc : _build/ext/ext.cmxa _build/common/common.cmxa _build/depends/depends.cmxa _build/ syntax/syntax.cmxa _build/core.cmxa
24
24
echo " Linking"
25
25
$(NATIVE ) -g -linkall -o $@ -I +compiler-libs ocamlcommon.cmxa $^ 2>> build.compile
26
26
# Note: we can remove main.cmx since we have js_main.cmx which use [js_implementation.implementation],
@@ -40,30 +40,41 @@ release:snapshot
40
40
$(NATIVE ) -w -a -I bin -I +compiler-libs ocamlcommon.cmxa unix.cmxa $^ -o $@
41
41
42
42
# # order matters
43
- _build/ocamlpack : _build/ext/ext.cmxa _build/common/common.cmxa _build/syntax/pack .cmxa _build/syntax/ocaml_pack_main .cmx
43
+ _build/ocamlpack : _build/ext/ext.cmxa _build/common/common.cmxa _build/depends/depends .cmxa _build/ocamlpack_main .cmx
44
44
$(NATIVE ) -I +compiler-libs ocamlcommon.cmxa unix.cmxa $^ -o $@
45
45
46
46
snapshot : ./bin/ocamlpack snapshotcmj
47
47
$(MAKE ) snapshotml
48
48
49
- snapshotml :./bin/ocamlpack ./bin/compiler.mllib
49
+ snapshotml :./bin/ocamlpack ./bin/compiler.mllib ./bin/bs_ppx.mllib
50
50
@echo " Snapshot ml"
51
51
$< bin/compiler.mllib > bin/compiler.ml
52
+ $< bin/bs_ppx.mllib > bin/bs_ppx.ml
52
53
snapshotcmj :
53
54
@echo " Collecting cmj files"
54
55
ocamlbuild -cflags $(OCAMLBUILD_CFLAGS ) -lflags -I,+compiler-libs,ocamlcommon.cmxa js_pack.native --
55
56
57
+ bootocamlpack : ./bin/ocamlpack
58
+ @echo " Bootstrap ocamlpack"
59
+ ./bin/ocamlpack bin/ocamlpack.mllib > ./bin/ocamlpack.ml
60
+ $(NATIVE ) -w -40 -I +compiler-libs unix.cmxa ocamlcommon.cmxa -I bin bin/ocamlpack.mli bin/ocamlpack.ml -o bin/ocamlpack
61
+ @echo " Using the bootstrapped ocamlpack to genreate new ocamlpack.ml: ` date` "
62
+ ./bin/ocamlpack bin/ocamlpack.mllib > ./bin/ocamlpack.ml
63
+ @echo " Bootstrap seems finished, please check diffs in ocamlpack"
64
+ git diff bin/ocamlpack.ml
56
65
57
66
releasebuild :
58
67
@echo " Make release compiler"
59
68
$(NATIVE ) -g -inline 1000 -linkall -w -a -I +compiler-libs -I bin ocamlcommon.cmxa bin/compiler.mli bin/compiler.ml -o bin/bsc
60
69
70
+ @echo "Make release ppx"
71
+ $(NATIVE) -g -inline 1000 -linkall -w -a -I +compiler-libs -I bin ocamlcommon.cmxa bin/bs_ppx.mli bin/bs_ppx.ml -o bin/bsppx
61
72
stdlib :
62
73
cd stdlib && ./build.sh
63
74
64
75
world :
65
76
@echo " Making compiler"
66
- $(NATIVE ) -g -inline 1000 -linkall -w -a -I +compiler-libs -I bin ocamlcommon.cmxa bin/compiler.mli bin/compiler.ml -o bin/bsc
77
+ $(MAKE ) releasebuild
67
78
@echo " Making compiler finished"
68
79
69
80
@echo "Making stdlib cmis"
@@ -91,23 +102,22 @@ world-test:
91
102
92
103
travis-world-test :./bin/ocamlpack
93
104
@echo " Generating the compiler"
94
- rm -f bin/compiler.ml
95
- ./bin/ocamlpack ./bin/compiler.mllib > bin/compiler.ml
105
+ rm -f bin/compiler.ml bin/bs_ppx.ml
106
+ $( MAKE ) snapshotml
96
107
@echo " Generating the compiler finished"
97
108
$(MAKE ) world-test
98
109
99
110
# no depend on ./bin/ocamlpack ./bin/bsc
100
111
# since in npm mode, they are generated from a single file
101
112
install :
102
- cp ./bin/bsc ../bin/
103
- cp ./runtime/* .cmt* ../lib/ocaml/
104
- cp ./runtime/* .cmj* ../lib/ocaml/
105
- cp ./runtime/js.cmi ./runtime/js_array.cmi ./runtime/js_string.cmi ./runtime/js_re.cmi ./runtime/js_unsafe.cmi ../lib/ocaml/
106
- cp ./stdlib/* .cm* ../lib/ocaml/
107
- cp ./others/* .cm* ../lib/ocaml/
108
- TMP_OCAMLLIB =$(shell ocamlopt.opt -where)
113
+ cp ./bin/bsc ./bin/bsppx ../bin/
114
+ cp ./runtime/* .cmt* ./runtime/* .cmj* ./stdlib/* .cm* ./others/* .cm* ../lib/ocaml/
115
+ cp ./runtime/js.ml ./runtime/js.cmi ./runtime/js_array.mli ./runtime/js_array.ml ./runtime/js_array.cmi ./runtime/js_string.ml ./runtime/js_string.mli ./runtime/js_string.cmi ./runtime/js_re.ml ./runtime/js_re.mli ./runtime/js_re.cmi ./runtime/js_unsafe.cmi ../lib/ocaml/
116
+
117
+
109
118
110
119
120
+ # TMP_OCAMLLIB=$(shell ocamlopt.opt -where)
111
121
# big-world:bin/big_compiler.ml bin/big_compiler.mli
112
122
# @echo "Making compiler"
113
123
# ocamlopt.opt -g -inline 1000 -linkall -w -a -I bin bin/big_compiler.mli bin/big_compiler.ml -o bin/bsc
@@ -125,7 +135,7 @@ TMP_OCAMLLIB=$(shell ocamlopt.opt -where)
125
135
126
136
127
137
.PHONY : stdlib
128
- .PHONY : test quicktest release snapshot snapshotcmj
138
+ .PHONY : test quicktest release snapshot snapshotcmj releasebuild
129
139
130
140
131
141
0 commit comments