1 #! /bin/sh
3 set -e
5 ###^^^^^^^^^^^^^^^^^^###
6 ### Global variables ###
7 ###__________________###
11 _compiler=
12 _linker=
14 _cross=false
15 _bootstrap=false
16 _stages=2
18 _cpu=
19 _target=
20 _system=
21 _host_cpu=
22 _host_target=
23 _host_system=
25 ###^^^^^^^^^^^###
26 ### Functions ###
27 ###___________###
29 usage() {
52 exit 2
53 }
55 error() {
57 exit 1
58 }
60 make_stage() {
65 shift 4
66 "$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
67 local _ext=
70 fi
73 _linker=
74 else
78 else
80 fi
81 fi
82 }
84 make_verify_stage() {
86 shift
89 else
91 fi
92 }
94 ###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
95 ### Parse arguments and options ###
96 ###_____________________________###
98 while getopts c:l:u:t:s:g:beh _name
99 do
107 b) _bootstrap=true ;;
108 e) _cross=true ;;
109 h|?) usage ;;
110 esac
111 done
114 usage
115 fi
118 usage
119 fi
128 fi
132 fi
136 fi
138 ###^^^^^^^^^^^^^^^^^^^^###
139 ### Bootstrap compiler ###
140 ###____________________###
144 _compiler=
145 _linker=
147 make_stage "$_this/bootstrap/$_host_cpu-cpfront-$_host_system" "$_host_cpu" "cpfront" "$_host_system" -b
148 else
150 fi
151 else
153 make_verify_stage 0
154 fi
156 ###^^^^^^^^^^^^^^^^^^###
157 ### Recompile itself ###
158 ###__________________###
161 do
164 done
165 _N=
167 ###^^^^^^^^^^^^^^^###
168 ### Cross compile ###
169 ###_______________###
174 fi