forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapshot.ninja
63 lines (50 loc) · 3.56 KB
/
snapshot.ninja
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
releaseMode = -D BS_RELEASE_BUILD=true
rule bspack
command = ./bin/bspack.exe $releaseMode $flags -bs-main $main -o $out $post_process
depfile = $out.d
generator = true
native_ocaml_path = ../ocaml/
snapshot_path = 4.06.1
LTO= ../scripts/buckle_lto.js
OCAML_SRC_UTILS=$native_ocaml_path/utils
OCAML_SRC_PARSING=$native_ocaml_path/parsing
OCAML_SRC_TYPING=$native_ocaml_path/typing
OCAML_SRC_BYTECOMP=$native_ocaml_path/bytecomp
OCAML_SRC_DRIVER=$native_ocaml_path/driver
OCAML_SRC_TOOLS=$native_ocaml_path/tools
includes = -I js_parser -I stubs -I ext -I common -I frontend -I depends -I core -I super_errors -I outcome_printer -I bsb -I ounit -I ounit_tests -I napkin -I main
SNAP=../lib/$snapshot_path
o snapshot: phony $SNAP/whole_compiler.ml $SNAP/bsb_helper.ml $SNAP/bsb.ml $SNAP/unstable/all_ounit_tests.ml
# $SNAP/bspp.ml
o $SNAP/whole_compiler.ml: bspack | ./bin/bspack.exe $LTO
flags = ${releaseMode} -D BS_ONLY=true -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_TYPING -I $OCAML_SRC_BYTECOMP -I $OCAML_SRC_DRIVER $includes
main = Js_main
post_process = && node $LTO $SNAP/whole_compiler.ml
o $SNAP/bsb_helper.ml: bspack | ./bin/bspack.exe $LTO
flags = -bs-MD ${releaseMode} -I stubs -I common -I ext -I frontend -I depends -I bsb_helper -I main
main = Bsb_helper_main
o $SNAP/bsb.ml: bspack | ./bin/bspack.exe $LTO
flags = -D BS_MIN_LEX_DEPS=true -bs-MD ${releaseMode} -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I stubs -I common -I ext -I frontend -I depends -I bsb -I ext -I main
main = Bsb_main
# o $SNAP/bspp.ml: bspack | ./bin/bspack.exe $LTO
# flags = -D BS_MIN_LEX_DEPS=true ${releaseMode} -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING?parser -I common -I ext -I frontend -I depends -I bspp -I core -I main
# main = Bspp_main
o $SNAP/unstable/all_ounit_tests.ml: bspack | ./bin/bspack.exe $LTO
flags = -bs-MD -I ounit -I ounit_tests -I stubs -I bsb -I bsb_helper -I common -I ext -I frontend -I depends -I bspp -I core -I main
main = Ounit_tests_main
o $SNAP/unstable/bspack.ml: bspack | ./bin/bspack.exe $LTO
flags = -D BS_PACK=true -bs-MD -module-alias Config=Config_whole_compiler -I $OCAML_SRC_PARSING -I $OCAML_SRC_UTILS -I stubs -I ext -I common -I depends -I core -I main -bs-main Bspack_main
main = Bspack_main
o $SNAP/unstable/js_compiler.ml: bspack | ./bin/bspack.exe $LTO
flags = -D BS_BROWSER=true -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_TYPING -I $OCAML_SRC_BYTECOMP -I $OCAML_SRC_DRIVER -I stubs -I ext -I napkin -I frontend -I depends -I common -I core -I super_errors -I bsb -I outcome_printer -I js_parser -I main
main = Jsoo_main
o $SNAP/unstable/js_refmt_compiler.ml: bspack | ./bin/bspack.exe $LTO
flags = -D BS_BROWSER=true -bs-MD -module-alias Config=Config_whole_compiler -bs-exclude-I config -I $OCAML_SRC_UTILS -I $OCAML_SRC_PARSING -I $OCAML_SRC_TYPING -I $OCAML_SRC_BYTECOMP -I $OCAML_SRC_DRIVER -I js_parser -I stubs -I ext -I napkin -I frontend -I depends -I common -I core -I super_errors -I bsb -I outcome_printer -I js_parser -I main -I refmt
main = Jsoo_refmt_main
subninja build.ninja
# -o $@
# Check it later
# rule bsbnative
# command = $ocamlopt -w -a unix.cmxa str.cmxa ./stubs/ext_basic_hash_stubs.c $in -o $out
# only check if it compiles
# o $SNAP/unstable/bsb_native.exe: bsbnative ./bin/bsb_native.ml