Add script to compile ocamlc

This commit is contained in:
Ekdohibs 2019-06-08 16:43:41 +02:00
parent 099f87006e
commit 1c0c729c96
9 changed files with 475 additions and 4 deletions

View File

@ -1,6 +1,6 @@
OBJS=interp.cmo
FLAGS=-annot -g -package compiler-libs.common -linkpkg
FLAGS=-g -package compiler-libs.common -linkpkg
OCAML=ocamlfind ocamlc
OCAMLOPT=ocamlfind ocamlopt
@ -17,3 +17,58 @@ interp: $(OBJS)
interpopt: $(OBJS:.cmo=.cmx)
$(OCAMLOPT) $(FLAGS) -linkpkg -o $@ $+
BOOT=_boot
OCAMLSRC=ocaml-src
configure-ocaml: $(OCAMLSRC)
cd $(OCAMLSRC) && bash configure
make -C $(OCAMLSRC) ocamlyacc && cp $(OCAMLSRC)/yacc/ocamlyacc $(OCAMLSRC)/boot
make -C $(OCAMLSRC)/stdlib sys.ml
make -C $(OCAMLSRC) utils/config.ml
make -C $(OCAMLSRC) parsing/parser.ml
make -C $(OCAMLSRC) CAMLLEX=ocamllex CAMLRUN=ocamlrun parsing/lexer.ml
make -C $(OCAMLSRC) bytecomp/runtimedef.ml
make -C $(OCAMLSRC) CAMLLEX=ocamllex CAMLRUN=ocamlrun CAMLC=ocamlc bytecomp/opcodes.ml
$(BOOT)/driver: $(OCAMLSRC)/driver configure-ocaml
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
$(BOOT)/bytecomp: $(OCAMLSRC)/bytecomp configure-ocaml
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
$(BOOT)/typing: $(OCAMLSRC)/typing configure-ocaml
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
$(BOOT)/parsing: $(OCAMLSRC)/parsing configure-ocaml patches/parsetree.patch
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
patch $(BOOT)/parsing/parsetree.mli patches/parsetree.patch
$(BOOT)/utils: $(OCAMLSRC)/utils configure-ocaml patches/disable-profiling.patch
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
cp $(BOOT)/utils/profile.ml $(BOOT)/utils/profile.ml.noprof
patch $(BOOT)/utils/profile.ml.noprof patches/disable-profiling.patch
$(BOOT)/stdlib: $(OCAMLSRC)/stdlib configure-ocaml patches/compflags.patch
mkdir -p $(BOOT)
rm -rf $@
cp -r $< $@
patch $(BOOT)/stdlib/Compflags patches/compflags.patch
awk -f $(BOOT)/stdlib/expand_module_aliases.awk < $(BOOT)/stdlib/stdlib.mli > $(BOOT)/stdlib/stdlib.pp.mli
awk -f $(BOOT)/stdlib/expand_module_aliases.awk < $(BOOT)/stdlib/stdlib.ml > $(BOOT)/stdlib/stdlib.pp.ml
copy: $(BOOT)/driver $(BOOT)/bytecomp $(BOOT)/typing $(BOOT)/parsing $(BOOT)/utils $(BOOT)/stdlib
$(BOOT)/ocamlc: copy
cd $(BOOT)/stdlib && ../../compile_stdlib.sh
cd $(BOOT) && ../compile_ocamlc.sh

222
compile_ocamlc.sh Normal file
View File

@ -0,0 +1,222 @@
#!/usr/bin/env bash
ulimit -s 2000000
export COMPILER="../miniml/interp/interp -g -nostdlib -I stdlib -use-prims byterun/primitives"
export COMPFLAGS="-strict-sequence -principal -absname -w +a-4-9-41-42-44-45-48 -warn-error A -bin-annot -safe-string -strict-formats -I utils -I parsing -I typing -I bytecomp -I middle_end -I middle_end/base_types -I asmcomp -I asmcomp/debug -I driver -I toplevel"
compile () {
echo $COMPILER $COMPFLAGS -c $@
$COMPILER $COMPFLAGS -c $@
}
compile utils/config.mli
compile utils/config.ml
compile utils/misc.mli
compile utils/misc.ml
compile utils/identifiable.mli
compile utils/identifiable.ml
compile utils/numbers.mli
compile utils/numbers.ml
compile utils/arg_helper.mli
compile utils/arg_helper.ml
compile utils/profile.mli
compile utils/clflags.mli
compile utils/clflags.ml
compile utils/tbl.mli
compile utils/tbl.ml
compile utils/profile.ml
compile utils/terminfo.mli
compile utils/terminfo.ml
compile utils/ccomp.mli
compile utils/ccomp.ml
compile utils/warnings.mli
compile utils/warnings.ml
compile utils/consistbl.mli
compile utils/consistbl.ml
compile utils/strongly_connected_components.mli
compile utils/strongly_connected_components.ml
compile utils/build_path_prefix_map.mli
compile utils/build_path_prefix_map.ml
compile utils/targetint.mli
compile utils/targetint.ml
compile parsing/location.mli
compile parsing/location.ml
compile parsing/longident.mli
compile parsing/longident.ml
compile parsing/asttypes.mli
compile parsing/parsetree.mli
compile parsing/docstrings.mli
compile parsing/docstrings.ml
compile parsing/syntaxerr.mli
compile parsing/syntaxerr.ml
compile parsing/ast_helper.mli
compile parsing/ast_helper.ml
compile parsing/parser.mli
compile parsing/parser.ml
compile parsing/lexer.mli
compile parsing/lexer.ml
compile parsing/parse.mli
compile parsing/parse.ml
compile parsing/printast.mli
compile parsing/printast.ml
compile parsing/pprintast.mli
compile parsing/pprintast.ml
compile parsing/ast_mapper.mli
compile parsing/ast_mapper.ml
compile parsing/ast_iterator.mli
compile parsing/ast_iterator.ml
compile parsing/attr_helper.mli
compile parsing/attr_helper.ml
compile parsing/builtin_attributes.mli
compile parsing/builtin_attributes.ml
compile parsing/ast_invariants.mli
compile parsing/ast_invariants.ml
compile parsing/depend.mli
compile parsing/depend.ml
compile typing/ident.mli
compile typing/ident.ml
compile typing/path.mli
compile typing/path.ml
compile typing/outcometree.mli
compile typing/primitive.mli
compile typing/primitive.ml
compile typing/types.mli
compile typing/types.ml
compile typing/btype.mli
compile typing/btype.ml
compile typing/oprint.mli
compile typing/oprint.ml
compile typing/subst.mli
compile typing/subst.ml
compile typing/predef.mli
compile typing/predef.ml
compile typing/datarepr.mli
compile typing/datarepr.ml
compile typing/cmi_format.mli
compile typing/cmi_format.ml
compile typing/env.mli
compile typing/env.ml
compile typing/typedtree.mli
compile typing/typedtree.ml
compile typing/printtyped.mli
compile typing/printtyped.ml
compile typing/ctype.mli
compile typing/ctype.ml
compile typing/printtyp.mli
compile typing/printtyp.ml
compile typing/includeclass.mli
compile typing/includeclass.ml
compile typing/mtype.mli
compile typing/mtype.ml
compile typing/envaux.mli
compile typing/envaux.ml
compile typing/includecore.mli
compile typing/includecore.ml
compile typing/typedtreeIter.mli
compile typing/typedtreeIter.ml
compile typing/typedtreeMap.mli
compile typing/typedtreeMap.ml
compile typing/tast_mapper.mli
compile typing/tast_mapper.ml
compile typing/cmt_format.mli
compile typing/cmt_format.ml
compile typing/untypeast.mli
compile typing/untypeast.ml
compile typing/includemod.mli
compile typing/includemod.ml
compile typing/typetexp.mli
compile typing/typetexp.ml
compile typing/printpat.mli
compile typing/printpat.ml
compile typing/parmatch.mli
compile typing/parmatch.ml
compile typing/annot.mli
compile typing/stypes.mli
compile typing/stypes.ml
compile typing/typedecl.mli
compile typing/typedecl.ml
compile bytecomp/lambda.mli
compile typing/typeopt.mli
compile typing/typeopt.ml
compile typing/typecore.mli
compile typing/typecore.ml
compile typing/typeclass.mli
compile typing/typeclass.ml
compile typing/typemod.mli
compile typing/typemod.ml
compile bytecomp/lambda.ml
compile bytecomp/printlambda.mli
compile bytecomp/printlambda.ml
compile bytecomp/semantics_of_primitives.mli
compile bytecomp/semantics_of_primitives.ml
compile bytecomp/switch.mli
compile bytecomp/switch.ml
compile bytecomp/matching.mli
compile bytecomp/matching.ml
compile bytecomp/translobj.mli
compile bytecomp/translobj.ml
compile bytecomp/translattribute.mli
compile bytecomp/translattribute.ml
compile bytecomp/translprim.mli
compile bytecomp/translprim.ml
compile bytecomp/translcore.mli
compile bytecomp/translcore.ml
compile bytecomp/translclass.mli
compile bytecomp/translclass.ml
compile bytecomp/translmod.mli
compile bytecomp/translmod.ml
compile bytecomp/simplif.mli
compile bytecomp/simplif.ml
compile bytecomp/runtimedef.mli
compile bytecomp/runtimedef.ml
compile bytecomp/instruct.mli
compile bytecomp/meta.mli
compile bytecomp/meta.ml
compile bytecomp/opcodes.ml
compile bytecomp/bytesections.mli
compile bytecomp/bytesections.ml
compile bytecomp/dll.mli
compile bytecomp/dll.ml
compile bytecomp/cmo_format.mli
compile bytecomp/symtable.mli
compile bytecomp/symtable.ml
compile driver/pparse.mli
compile driver/pparse.ml
compile driver/main_args.mli
compile driver/main_args.ml
compile driver/compenv.mli
compile driver/compenv.ml
compile driver/compmisc.mli
compile driver/compmisc.ml
compile driver/compdynlink.mli
compile -impl driver/compdynlink.mlbyte
compile driver/compplugin.mli
compile driver/compplugin.ml
compile driver/makedepend.mli
compile driver/makedepend.ml
echo $COMPILER -a -linkall -o compilerlibs/ocamlcommon.cma utils/config.cmo utils/misc.cmo utils/identifiable.cmo utils/numbers.cmo utils/arg_helper.cmo utils/clflags.cmo utils/tbl.cmo utils/profile.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo utils/consistbl.cmo utils/strongly_connected_components.cmo utils/build_path_prefix_map.cmo utils/targetint.cmo parsing/location.cmo parsing/longident.cmo parsing/docstrings.cmo parsing/syntaxerr.cmo parsing/ast_helper.cmo parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo parsing/pprintast.cmo parsing/ast_mapper.cmo parsing/ast_iterator.cmo parsing/attr_helper.cmo parsing/builtin_attributes.cmo parsing/ast_invariants.cmo parsing/depend.cmo typing/ident.cmo typing/path.cmo typing/primitive.cmo typing/types.cmo typing/btype.cmo typing/oprint.cmo typing/subst.cmo typing/predef.cmo typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo typing/printtyp.cmo typing/includeclass.cmo typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/tast_mapper.cmo typing/cmt_format.cmo typing/untypeast.cmo typing/includemod.cmo typing/typetexp.cmo typing/printpat.cmo typing/parmatch.cmo typing/stypes.cmo typing/typedecl.cmo typing/typeopt.cmo typing/typecore.cmo typing/typeclass.cmo typing/typemod.cmo bytecomp/lambda.cmo bytecomp/printlambda.cmo bytecomp/semantics_of_primitives.cmo bytecomp/switch.cmo bytecomp/matching.cmo bytecomp/translobj.cmo bytecomp/translattribute.cmo bytecomp/translprim.cmo bytecomp/translcore.cmo bytecomp/translclass.cmo bytecomp/translmod.cmo bytecomp/simplif.cmo bytecomp/runtimedef.cmo bytecomp/meta.cmo bytecomp/opcodes.cmo bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo driver/pparse.cmo driver/main_args.cmo driver/compenv.cmo driver/compmisc.cmo driver/compdynlink.cmo driver/compplugin.cmo driver/makedepend.cmo
$COMPILER -a -linkall -o compilerlibs/ocamlcommon.cma utils/config.cmo utils/misc.cmo utils/identifiable.cmo utils/numbers.cmo utils/arg_helper.cmo utils/clflags.cmo utils/tbl.cmo utils/profile.cmo utils/terminfo.cmo utils/ccomp.cmo utils/warnings.cmo utils/consistbl.cmo utils/strongly_connected_components.cmo utils/build_path_prefix_map.cmo utils/targetint.cmo parsing/location.cmo parsing/longident.cmo parsing/docstrings.cmo parsing/syntaxerr.cmo parsing/ast_helper.cmo parsing/parser.cmo parsing/lexer.cmo parsing/parse.cmo parsing/printast.cmo parsing/pprintast.cmo parsing/ast_mapper.cmo parsing/ast_iterator.cmo parsing/attr_helper.cmo parsing/builtin_attributes.cmo parsing/ast_invariants.cmo parsing/depend.cmo typing/ident.cmo typing/path.cmo typing/primitive.cmo typing/types.cmo typing/btype.cmo typing/oprint.cmo typing/subst.cmo typing/predef.cmo typing/datarepr.cmo typing/cmi_format.cmo typing/env.cmo typing/typedtree.cmo typing/printtyped.cmo typing/ctype.cmo typing/printtyp.cmo typing/includeclass.cmo typing/mtype.cmo typing/envaux.cmo typing/includecore.cmo typing/typedtreeIter.cmo typing/typedtreeMap.cmo typing/tast_mapper.cmo typing/cmt_format.cmo typing/untypeast.cmo typing/includemod.cmo typing/typetexp.cmo typing/printpat.cmo typing/parmatch.cmo typing/stypes.cmo typing/typedecl.cmo typing/typeopt.cmo typing/typecore.cmo typing/typeclass.cmo typing/typemod.cmo bytecomp/lambda.cmo bytecomp/printlambda.cmo bytecomp/semantics_of_primitives.cmo bytecomp/switch.cmo bytecomp/matching.cmo bytecomp/translobj.cmo bytecomp/translattribute.cmo bytecomp/translprim.cmo bytecomp/translcore.cmo bytecomp/translclass.cmo bytecomp/translmod.cmo bytecomp/simplif.cmo bytecomp/runtimedef.cmo bytecomp/meta.cmo bytecomp/opcodes.cmo bytecomp/bytesections.cmo bytecomp/dll.cmo bytecomp/symtable.cmo driver/pparse.cmo driver/main_args.cmo driver/compenv.cmo driver/compmisc.cmo driver/compdynlink.cmo driver/compplugin.cmo driver/makedepend.cmo
compile bytecomp/instruct.ml
compile bytecomp/bytegen.mli
compile bytecomp/bytegen.ml
compile bytecomp/printinstr.mli
compile bytecomp/printinstr.ml
compile bytecomp/emitcode.mli
compile bytecomp/emitcode.ml
compile bytecomp/bytelink.mli
compile bytecomp/bytelink.ml
compile bytecomp/bytelibrarian.mli
compile bytecomp/bytelibrarian.ml
compile bytecomp/bytepackager.mli
compile bytecomp/bytepackager.ml
compile driver/errors.mli
compile driver/errors.ml
compile driver/compile.mli
compile driver/compile.ml
echo $COMPILER -a -o compilerlibs/ocamlbytecomp.cma bytecomp/instruct.cmo bytecomp/bytegen.cmo bytecomp/printinstr.cmo bytecomp/emitcode.cmo bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo driver/errors.cmo driver/compile.cmo
$COMPILER -a -o compilerlibs/ocamlbytecomp.cma bytecomp/instruct.cmo bytecomp/bytegen.cmo bytecomp/printinstr.cmo bytecomp/emitcode.cmo bytecomp/bytelink.cmo bytecomp/bytelibrarian.cmo bytecomp/bytepackager.cmo driver/errors.cmo driver/compile.cmo
compile driver/main.mli
compile driver/main.ml
echo $COMPILER -compat-32 -o ocamlc compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma driver/main.cmo
$COMPILER -compat-32 -o ocamlc compilerlibs/ocamlcommon.cma compilerlibs/ocamlbytecomp.cma driver/main.cmo

123
compile_stdlib.sh Executable file
View File

@ -0,0 +1,123 @@
#!/usr/bin/env bash
ulimit -s 2000000
export COMPILER=../../miniml/interp/interp
export COMPFLAGS="-strict-sequence -absname -w +a-4-9-41-42-44-45-48 -g -warn-error A -bin-annot -nostdlib -safe-string -strict-formats"
compile () {
# Target = $1, source = $2
echo $COMPILER $COMPFLAGS $(./Compflags $1) -o $1 -c $2
$COMPILER $COMPFLAGS $(./Compflags $1) -o $1 -c $2
}
compile camlinternalFormatBasics.cmi camlinternalFormatBasics.mli
compile camlinternalFormatBasics.cmo camlinternalFormatBasics.ml
compile stdlib.cmi stdlib.pp.mli
compile stdlib.cmo stdlib.pp.ml
compile stdlib__seq.cmi seq.mli
compile stdlib__seq.cmo seq.ml
compile stdlib__char.cmi char.mli
compile stdlib__char.cmo char.ml
compile stdlib__uchar.cmi uchar.mli
compile stdlib__uchar.cmo uchar.ml
compile stdlib__sys.cmi sys.mli
compile stdlib__sys.cmo sys.ml
compile stdlib__list.cmi list.mli
compile stdlib__list.cmo list.ml
compile stdlib__bytes.cmi bytes.mli
compile stdlib__bytes.cmo bytes.ml
compile stdlib__string.cmi string.mli
compile stdlib__string.cmo string.ml
compile stdlib__array.cmi array.mli
compile stdlib__sort.cmi sort.mli
compile stdlib__sort.cmo sort.ml
compile stdlib__marshal.cmi marshal.mli
compile stdlib__marshal.cmo marshal.ml
compile stdlib__int32.cmi int32.mli
compile stdlib__obj.cmi obj.mli
compile stdlib__obj.cmo obj.ml
compile stdlib__float.cmi float.mli
compile stdlib__float.cmo float.ml
compile stdlib__array.cmo array.ml
compile stdlib__int32.cmo int32.ml
compile stdlib__int64.cmi int64.mli
compile stdlib__int64.cmo int64.ml
compile stdlib__nativeint.cmi nativeint.mli
compile stdlib__nativeint.cmo nativeint.ml
compile stdlib__lexing.cmi lexing.mli
compile stdlib__lexing.cmo lexing.ml
compile stdlib__parsing.cmi parsing.mli
compile stdlib__parsing.cmo parsing.ml
compile stdlib__set.cmi set.mli
compile stdlib__set.cmo set.ml
compile stdlib__map.cmi map.mli
compile stdlib__map.cmo map.ml
compile stdlib__stack.cmi stack.mli
compile stdlib__stack.cmo stack.ml
compile stdlib__queue.cmi queue.mli
compile stdlib__queue.cmo queue.ml
compile camlinternalLazy.cmi camlinternalLazy.mli
compile camlinternalLazy.cmo camlinternalLazy.ml
compile stdlib__lazy.cmi lazy.mli
compile stdlib__lazy.cmo lazy.ml
compile stdlib__stream.cmi stream.mli
compile stdlib__stream.cmo stream.ml
compile stdlib__buffer.cmi buffer.mli
compile stdlib__buffer.cmo buffer.ml
compile camlinternalFormat.cmi camlinternalFormat.mli
compile camlinternalFormat.cmo camlinternalFormat.ml
compile stdlib__printf.cmi printf.mli
compile stdlib__printf.cmo printf.ml
compile stdlib__arg.cmi arg.mli
compile stdlib__arg.cmo arg.ml
compile stdlib__printexc.cmi printexc.mli
compile stdlib__printexc.cmo printexc.ml
compile stdlib__gc.cmi gc.mli
compile stdlib__gc.cmo gc.ml
compile stdlib__digest.cmi digest.mli
compile stdlib__digest.cmo digest.ml
compile stdlib__random.cmi random.mli
compile stdlib__random.cmo random.ml
compile stdlib__hashtbl.cmi hashtbl.mli
compile stdlib__hashtbl.cmo hashtbl.ml
compile stdlib__weak.cmi weak.mli
compile stdlib__weak.cmo weak.ml
compile stdlib__format.cmi format.mli
compile stdlib__format.cmo format.ml
compile stdlib__scanf.cmi scanf.mli
compile stdlib__scanf.cmo scanf.ml
compile stdlib__callback.cmi callback.mli
compile stdlib__callback.cmo callback.ml
compile camlinternalOO.cmi camlinternalOO.mli
compile camlinternalOO.cmo camlinternalOO.ml
compile stdlib__oo.cmi oo.mli
compile stdlib__oo.cmo oo.ml
compile camlinternalMod.cmi camlinternalMod.mli
compile camlinternalMod.cmo camlinternalMod.ml
compile stdlib__genlex.cmi genlex.mli
compile stdlib__genlex.cmo genlex.ml
compile stdlib__ephemeron.cmi ephemeron.mli
compile stdlib__ephemeron.cmo ephemeron.ml
compile stdlib__filename.cmi filename.mli
compile stdlib__filename.cmo filename.ml
compile stdlib__complex.cmi complex.mli
compile stdlib__complex.cmo complex.ml
compile stdlib__arrayLabels.cmi arrayLabels.mli
compile stdlib__arrayLabels.cmo arrayLabels.ml
compile stdlib__listLabels.cmi listLabels.mli
compile stdlib__listLabels.cmo listLabels.ml
compile stdlib__bytesLabels.cmi bytesLabels.mli
compile stdlib__bytesLabels.cmo bytesLabels.ml
compile stdlib__stringLabels.cmi stringLabels.mli
compile stdlib__stringLabels.cmo stringLabels.ml
compile stdlib__moreLabels.cmi moreLabels.mli
compile stdlib__moreLabels.cmo moreLabels.ml
compile stdlib__stdLabels.cmi stdLabels.mli
compile stdlib__stdLabels.cmo stdLabels.ml
compile stdlib__spacetime.cmi spacetime.mli
compile stdlib__spacetime.cmo spacetime.ml
compile stdlib__bigarray.cmi bigarray.mli
compile stdlib__bigarray.cmo bigarray.ml
$COMPILER -a -o stdlib.cma camlinternalFormatBasics.cmo stdlib.cmo stdlib__seq.cmo stdlib__char.cmo stdlib__uchar.cmo stdlib__sys.cmo stdlib__list.cmo stdlib__bytes.cmo stdlib__string.cmo stdlib__sort.cmo stdlib__marshal.cmo stdlib__obj.cmo stdlib__float.cmo stdlib__array.cmo stdlib__int32.cmo stdlib__int64.cmo stdlib__nativeint.cmo stdlib__lexing.cmo stdlib__parsing.cmo stdlib__set.cmo stdlib__map.cmo stdlib__stack.cmo stdlib__queue.cmo camlinternalLazy.cmo stdlib__lazy.cmo stdlib__stream.cmo stdlib__buffer.cmo camlinternalFormat.cmo stdlib__printf.cmo stdlib__arg.cmo stdlib__printexc.cmo stdlib__gc.cmo stdlib__digest.cmo stdlib__random.cmo stdlib__hashtbl.cmo stdlib__weak.cmo stdlib__format.cmo stdlib__scanf.cmo stdlib__callback.cmo camlinternalOO.cmo stdlib__oo.cmo camlinternalMod.cmo stdlib__genlex.cmo stdlib__ephemeron.cmo stdlib__filename.cmo stdlib__complex.cmo stdlib__arrayLabels.cmo stdlib__listLabels.cmo stdlib__bytesLabels.cmo stdlib__stringLabels.cmo stdlib__moreLabels.cmo stdlib__stdLabels.cmo stdlib__spacetime.cmo stdlib__bigarray.cmo
$COMPILER $COMPFLAGS -c std_exit.ml

58
miniml/asttypes.mli Normal file
View File

@ -0,0 +1,58 @@
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Xavier Leroy, projet Cristal, INRIA Rocquencourt *)
(* *)
(* Copyright 1996 Institut National de Recherche en Informatique et *)
(* en Automatique. *)
(* *)
(* All rights reserved. This file is distributed under the terms of *)
(* the GNU Lesser General Public License version 2.1, with the *)
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
(** Auxiliary AST types used by parsetree and typedtree. *)
type constant =
Const_int of int
| Const_char of char
| Const_string of string * string option
| Const_float of string
| Const_int32 of int32
| Const_int64 of int64
| Const_nativeint of nativeint
type rec_flag = Nonrecursive | Recursive
type direction_flag = Upto | Downto
(* Order matters, used in polymorphic comparison *)
type private_flag = Private | Public
type mutable_flag = Immutable | Mutable
type virtual_flag = Virtual | Concrete
type override_flag = Override | Fresh
type closed_flag = Closed | Open
type label = string
type arg_label =
Nolabel
| Labelled of string (* label:T -> ... *)
| Optional of string (* ?label:T -> ... *)
type 'a loc = 'a Location.loc = {
txt : 'a;
loc : Location.t;
}
type variance =
| Covariant
| Contravariant
| Invariant

View File

@ -10,7 +10,7 @@ interp.c: out.ml
out.ml: buffer.ml lexing.ml parsing.ml misc.ml clflags.ml location.ml asttypes.mli warnings.ml syntaxerr.ml docstrings.ml longident.ml parsetree.mli ast_helper.ml parser.ml lexer.ml interp.ml
./genfile.sh
lexing.ml: lexing.mll
lexer.ml: lexer.mll
$(OCAMLLEX) $<
sed -i "s/lexbuf.Lexing.refill_buff/Lexing.refill_buff/" $@

View File

@ -1368,7 +1368,7 @@ let stdlib_modules = [
("Marshal", "marshal.ml");
]
let stdlib_path = "/home/nathanael/.opam/4.07.0/lib/ocaml"
let stdlib_path = "/home/nathanael/Projects/camlboot/_boot/stdlib" (* "/home/nathanael/.opam/4.07.0/lib/stdlib/ocaml" *)
let stdlib_modules = List.map (fun np -> let (n, p) = np in (n, stdlib_path ^ "/" ^ p)) stdlib_modules
let load_modules env modules =
@ -1511,7 +1511,7 @@ let compiler_modules = [
("Main", "driver/main.ml");
]
let compiler_path = (*"/home/nathanael/.opam/4.07.0/lib/ocaml/compiler-libs"*) "/home/nathanael/Projects/ocaml"
let compiler_path = "/home/nathanael/Projects/camlboot/_boot" (* "/home/nathanael/Projects/ocaml" *)
let compiler_modules = List.map (fun np -> let (n, p) = np in (n, compiler_path ^ "/" ^ p)) compiler_modules
let _ =

5
patches/compflags.patch Normal file
View File

@ -0,0 +1,5 @@
19,20c19
< echo ' -nopervasives -no-alias-deps -w -49' \
< ' -pp "$AWK -f expand_module_aliases.awk"';;
---
> echo ' -nopervasives -no-alias-deps -w -49';;

View File

@ -0,0 +1,4 @@
99c99
<
---
> let record_call ?(accumulate = false) name f = f ()

4
patches/parsetree.patch Normal file
View File

@ -0,0 +1,4 @@
31c31
< {delim|other constant|delim}
---
>