696571af89f7c3560845482592976bd84d2dac7e
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() {
51 exit 2
52 }
54 error() {
56 exit 1
57 }
59 make_stage() {
64 shift 4
65 "$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
68 _linker=
69 else
73 else
75 fi
76 fi
77 }
79 make_verify_stage() {
81 shift
84 else
86 fi
87 }
89 ###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
90 ### Parse arguments and options ###
91 ###_____________________________###
93 while getopts c:l:u:t:s:g:beh _name
94 do
102 b) _bootstrap=true ;;
103 e) _cross=true ;;
104 h|?) usage ;;
105 esac
106 done
109 usage
110 fi
113 usage
114 fi
123 fi
127 fi
131 fi
133 ###^^^^^^^^^^^^^^^^^^^^###
134 ### Bootstrap compiler ###
135 ###____________________###
139 _compiler=
140 _linker=
142 make_stage "$_this/bootstrap/$_host_cpu-cpfront-$_host_system" "$_host_cpu" "cpfront" "$_host_system" -b
143 else
145 fi
146 else
148 make_verify_stage 0
149 fi
151 ###^^^^^^^^^^^^^^^^^^###
152 ### Recompile itself ###
153 ###__________________###
156 do
159 done
160 _N=
162 ###^^^^^^^^^^^^^^^###
163 ### Cross compile ###
164 ###_______________###
169 fi