71fc18e56e96a3f5f5c50468e851a5395a20fff7
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=
28 ###^^^^^^^^^^^###
29 ### Functions ###
30 ###___________###
32 usage() {
57 exit 2
58 }
60 error() {
62 exit 1
63 }
65 make_stage() {
70 shift 4
71 "$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
72 local _ext=
75 fi
78 _linker=
79 else
83 else
85 fi
86 fi
87 }
89 make_verify_stage() {
91 shift
94 else
96 fi
97 }
99 ###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
100 ### Parse arguments and options ###
101 ###_____________________________###
103 while getopts c:l:u:t:s:g:beh _name
104 do
112 b) _bootstrap=true ;;
113 e) _cross=true ;;
114 h|?) usage ;;
115 esac
116 done
119 usage
120 fi
123 usage
124 fi
133 fi
137 fi
141 fi
143 ###^^^^^^^^^^^^^^^^^^^^###
144 ### Bootstrap compiler ###
145 ###____________________###
149 _compiler=
150 _linker=
152 make_stage "$_this/bootstrap/$_host_cpu-cpfront-$_host_system" "$_host_cpu" "cpfront" "$_host_system" -b
153 else
155 fi
156 else
158 make_verify_stage 0
159 fi
161 ###^^^^^^^^^^^^^^^^^^###
162 ### Recompile itself ###
163 ###__________________###
166 do
169 done
170 _N=
172 ###^^^^^^^^^^^^^^^###
173 ### Cross compile ###
174 ###_______________###
179 fi