-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap-mk.sh
executable file
·137 lines (127 loc) · 8.73 KB
/
bootstrap-mk.sh
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/bin/sh
# Script to compile 'mk' (and 'rc') without using 'mk' (nor 'rc') and generate
# a bin/mk (and bin/rc) so that we don't need a BOOTSTRAP/Linux/386/bin/mk
# like in kencc. Note that kencc has no BOOTSTRAP/Linux/386/bin/rc because
# it assumes the presence of a shell and can work with both 'rc' and 'sh'.
#
# Note that right now to boostrap Xix we still need:
# - OCaml (which itself requires to bootstrap ocamllex, ocamlyacc and C)
# - the ocamlfind tool and stdcompat library
# - a C compiler
# - /bin/sh
# - probably many other things
#
# Maybe at some point the assembler/linker/compiler in this repo will
# be able to bootstrap itself and we will just need an ocamlrun bytecode
# version of those tools in BOOTSTRAP/.
#
# This file was mostly auto-generated by copy-pasting a trace of mk.
# any error should abort the script
set -e
# for showing the executed commands (verbose)
set -x
# Limit to just stdcompat! This is Xix!
EXTERNAL_LIB=`ocamlfind query stdcompat`
#coupling: mkconfig COMPFLAGS
OCAMLCFLAGS="-I $EXTERNAL_LIB -g"
#coupling: mkconfig LINKFLAGS
EXTRALINKFLAGS="-I $EXTERNAL_LIB stdcompat.cma -custom -g"
TOP=`pwd`
cd $TOP/lib_core/collections/
ocamlc.opt $OCAMLCFLAGS -c set_.mli
ocamlc.opt $OCAMLCFLAGS -c map_.mli
ocamlc.opt $OCAMLCFLAGS -c set_.ml
ocamlc.opt $OCAMLCFLAGS -c map_.ml
ocamlc.opt set_.cmo map_.cmo -a -o lib.cma
cd $TOP/lib_core/commons/
ocamlc.opt $OCAMLCFLAGS -c common.mli
ocamlc.opt $OCAMLCFLAGS -c common2.ml
ocamlc.opt $OCAMLCFLAGS -c IO.mli
ocamlc.opt $OCAMLCFLAGS -c Logs.mli
ocamlc.opt $OCAMLCFLAGS -c date.mli
ocamlc.opt $OCAMLCFLAGS -c common.ml
ocamlc.opt $OCAMLCFLAGS -c ocaml.mli
ocamlc.opt $OCAMLCFLAGS -c Logs.ml
ocamlc.opt $OCAMLCFLAGS -c date.ml
ocamlc.opt $OCAMLCFLAGS -c IO.ml
ocamlc.opt $OCAMLCFLAGS -c ocaml.ml
ocamlc.opt -I . common.cmo common2.cmo ocaml.cmo IO.cmo Logs.cmo date.cmo -a -o lib.cma
cd $TOP/mk
ocamlyacc parser.mly
ocamllex lexer.mll
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c globals.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c flags.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c ast.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c shellenv.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c percent.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c file.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c shellenv.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c shell.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c env.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parser.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parse.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c percent.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c rules.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c file.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c shell.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c env.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parser.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c lexer.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c eval.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c graph.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parse.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c eval.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c graph.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c job.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c outofdate.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c scheduler.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c scheduler.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c outofdate.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c main.ml
ocamlc.opt $EXTRALINKFLAGS -I ../lib_core/commons -I ../lib_core/collections str.cma unix.cma ../lib_core/collections/lib.cma ../lib_core/commons/lib.cma globals.cmo flags.cmo ast.cmo parser.cmo lexer.cmo parse.cmo shellenv.cmo shell.cmo percent.cmo env.cmo rules.cmo eval.cmo file.cmo graph.cmo job.cmo scheduler.cmo outofdate.cmo main.cmo ../lib_core/collections/lib.cma ../lib_core/commons/lib.cma -o mk
cd $TOP/shell/
ocamlyacc parser.mly
ocamllex lexer.mll
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c flags.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c globals.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c ast.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c opcode.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c pattern.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c prompt.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c status.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c path.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c process.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c error.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c builtin.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c meta_ast.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parser.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parse.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c meta_opcode.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c dumper.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c compile.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c runtime.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c interpreter.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c pattern.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parser.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c dumper.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c compile.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c fn.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c var.mli
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c process.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c error.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c lexer.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c op_process.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c fn.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c var.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c prompt.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c status.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c path.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c builtin.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c op_repl.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c main.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c parse.ml
ocamlc.opt $OCAMLCFLAGS -I ../lib_core/commons -I ../lib_core/collections -c interpreter.ml
ocamlc.opt $EXTRALINKFLAGS -I ../lib_core/commons -I ../lib_core/collections str.cma unix.cma ../lib_core/collections/lib.cma ../lib_core/commons/lib.cma flags.cmo globals.cmo ast.cmo meta_ast.cmo opcode.cmo meta_opcode.cmo dumper.cmo compile.cmo runtime.cmo pattern.cmo fn.cmo var.cmo prompt.cmo status.cmo path.cmo process.cmo error.cmo parser.cmo lexer.cmo parse.cmo builtin.cmo op_repl.cmo op_process.cmo interpreter.cmo main.cmo ../lib_core/collections/lib.cma ../lib_core/commons/lib.cma -o rc
cd $TOP
cp mk/mk shell/rc bin/
echo 'Copy bin/mk bin/rc somewhere in your PATH and sets MKSHELL to point to rc.'