Skip to content

Commit 14f1175

Browse files
authored
Merge pull request #1010 from bloomberg/bootstrap_bspack
bootstrap bspack with c capabilities
2 parents d7181be + 568e2dd commit 14f1175

File tree

5 files changed

+2444
-1775
lines changed

5 files changed

+2444
-1775
lines changed

jscomp/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,10 @@ bin/js_compiler.byte:bin/js_compiler.mli bin/js_compiler.ml
346346

347347
bootbspack:
348348
@echo "Bootstrap bspack.exe"
349-
./bin/bspack.exe -bs-MD -prelude-str 'module Config = Config_bspack ' -bs-exclude-I config -I ../ocaml/parsing/ -I ../ocaml/utils/ -I ext -I common -I depends -I core -bs-main Bspack_main -o bin/bspack.ml
350-
$(NATIVE) -w -40 unix.cmxa -I bin bin/config_bspack.mli bin/config_bspack.ml bin/bspack.mli bin/bspack.ml -o bin/bspack.exe
349+
./bin/bspack.exe -bs-MD -prelude-str 'module Config = Config_bspack ' -bs-exclude-I config -I ../ocaml/parsing/ -I ../ocaml/utils/ -I stubs -I ext -I common -I depends -I core -bs-main Bspack_main -o bin/bspack.ml
350+
$(NATIVE) ./stubs/ext_basic_hash_stubs.c -w -40 unix.cmxa -I bin bin/config_bspack.mli bin/config_bspack.ml bin/bspack.mli bin/bspack.ml -o bin/bspack.exe
351351
@echo "Using the bootstrapped bspack.exe to genreate new bspack.ml: `date`"
352-
./bin/bspack.exe -bs-MD -prelude-str 'module Config = Config_bspack' -bs-exclude-I config -I ../ocaml/parsing/ -I ../ocaml/utils/ -I ext -I common -I depends -I core -bs-main Bspack_main -o bin/bspack.ml
352+
./bin/bspack.exe -bs-MD -prelude-str 'module Config = Config_bspack' -bs-exclude-I config -I ../ocaml/parsing/ -I ../ocaml/utils/ -I stubs -I ext -I common -I depends -I core -bs-main Bspack_main -o bin/bspack.ml
353353
@echo "Bootstrap seems finished, please check diffs in bspack.exe"
354354
@echo "Rebuilding bspack.exe"
355355
make -C bin -B bspack.exe

jscomp/bin/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ ifndef EXE
66
endif
77
NATIVE=ocamlopt.opt$(EXE)
88

9+
OCAMLOPT_FLAGS= -inline 1000 -w -a ../stubs/ext_basic_hash_stubs.c
10+
911
bsppx.exe: config_bsppx.mli config_bsppx.ml bsppx.mli bsppx.ml
1012
$(NATIVE) -g -inline 1000 -linkall -w -a $^ -o $@
1113

@@ -27,7 +29,7 @@ bsc.exe: config_whole_compiler.mli config_whole_compiler.ml whole_compiler.mli
2729
$(NATIVE) -w -a ../stubs/ext_basic_hash_stubs.c $^ -o $@
2830

2931
bspack.exe: config_bspack.mli config_bspack.ml bspack.mli bspack.ml
30-
$(NATIVE) -w -a unix.cmxa $^ -o $@
32+
$(NATIVE) $(OCAMLOPT_FLAGS) unix.cmxa $^ -o $@
3133

3234

3335
all: bsppx.exe bspp.exe bsdep.exe bsc.exe bspack.exe bsb.exe bsb_helper.exe

jscomp/bin/bspack.d

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ bin/bspack.ml : ../ocaml/utils/warnings.ml
44
bin/bspack.ml : ../ocaml/utils/warnings.mli
55
bin/bspack.ml : ../ocaml/parsing/location.ml
66
bin/bspack.ml : ../ocaml/parsing/location.mli
7+
bin/bspack.ml : depends/bs_exception.ml
8+
bin/bspack.ml : depends/bs_exception.mli
9+
bin/bspack.ml : ../ocaml/utils/clflags.ml
10+
bin/bspack.ml : ../ocaml/utils/clflags.mli
711
bin/bspack.ml : ../ocaml/parsing/asttypes.mli
812
bin/bspack.ml : ../ocaml/utils/misc.ml
913
bin/bspack.ml : ../ocaml/utils/misc.mli
1014
bin/bspack.ml : ../ocaml/parsing/longident.ml
1115
bin/bspack.ml : ../ocaml/parsing/longident.mli
1216
bin/bspack.ml : ../ocaml/parsing/parsetree.mli
13-
bin/bspack.ml : common/binary_ast.ml
14-
bin/bspack.ml : common/binary_ast.mli
17+
bin/bspack.ml : ../ocaml/parsing/depend.ml
18+
bin/bspack.ml : ../ocaml/parsing/depend.mli
1519
bin/bspack.ml : ext/ext_pervasives.ml
1620
bin/bspack.ml : ext/ext_pervasives.mli
1721
bin/bspack.ml : ext/ext_bytes.ml
@@ -22,22 +26,15 @@ bin/bspack.ml : ext/literals.ml
2226
bin/bspack.ml : ext/literals.mli
2327
bin/bspack.ml : ext/ext_filename.ml
2428
bin/bspack.ml : ext/ext_filename.mli
25-
bin/bspack.ml : ext/string_map.ml
26-
bin/bspack.ml : ext/string_map.mli
27-
bin/bspack.ml : common/binary_cache.ml
28-
bin/bspack.ml : common/binary_cache.mli
29-
bin/bspack.ml : common/bs_exception.ml
30-
bin/bspack.ml : common/bs_exception.mli
31-
bin/bspack.ml : ../ocaml/utils/clflags.ml
32-
bin/bspack.ml : ../ocaml/utils/clflags.mli
33-
bin/bspack.ml : ../ocaml/parsing/depend.ml
34-
bin/bspack.ml : ../ocaml/parsing/depend.mli
3529
bin/bspack.ml : ext/ext_format.ml
3630
bin/bspack.ml : ext/ext_format.mli
3731
bin/bspack.ml : ext/ext_list.ml
3832
bin/bspack.ml : ext/ext_list.mli
3933
bin/bspack.ml : common/js_config.ml
4034
bin/bspack.ml : common/js_config.mli
35+
bin/bspack.ml : ext/map_gen.ml
36+
bin/bspack.ml : ext/string_map.ml
37+
bin/bspack.ml : ext/string_map.mli
4138
bin/bspack.ml : depends/ast_extract.ml
4239
bin/bspack.ml : depends/ast_extract.mli
4340
bin/bspack.ml : ext/ext_io.ml
@@ -54,5 +51,11 @@ bin/bspack.ml : ../ocaml/parsing/lexer.ml
5451
bin/bspack.ml : ../ocaml/parsing/lexer.mli
5552
bin/bspack.ml : ../ocaml/parsing/parse.ml
5653
bin/bspack.ml : ../ocaml/parsing/parse.mli
54+
bin/bspack.ml : stubs/bs_hash_stubs.ml
55+
bin/bspack.ml : ext/ext_util.ml
56+
bin/bspack.ml : ext/ext_util.mli
57+
bin/bspack.ml : ext/hashtbl_gen.ml
58+
bin/bspack.ml : ext/string_hashtbl.ml
59+
bin/bspack.ml : ext/string_hashtbl.mli
5760
bin/bspack.ml : core/bspack_main.ml
5861
bin/bspack.ml : core/bspack_main.mli

0 commit comments

Comments
 (0)