1 #! /bin/sh
3 set -e
5 ###^^^^^^^^^^^^^^^^^^###
6 ### Global variables ###
7 ###__________________###
11 _compiler=
12 _linker=
14 _cross=false
15 _bootstrap=false
16 _verify=true
18 _cpu=
19 _target=
20 _system=
21 _host_cpu=
22 _host_system=
24 ###^^^^^^^^^^^###
25 ### Functions ###
26 ###___________###
28 usage() {
45 exit 2
46 }
48 error() {
50 exit 1
51 }
53 make_stage() {
58 shift 4
59 "$_this/make.sh" -o "$_dir" -c "$_compiler" -l "$_linker" "$@" "$_this_cpu" "$_this_target" "$_this_system"
62 _linker=
63 else
67 else
69 fi
70 fi
71 }
73 ###^^^^^^^^^^^^^^^^^^^^^^^^^^^^^###
74 ### Parse arguments and options ###
75 ###_____________________________###
77 while getopts c:l:u:s:bveh _name
78 do
84 b) _bootstrap=true ;;
85 v) _verify=false ;;
86 e) _cross=true ;;
87 h|?) usage ;;
88 esac
89 done
92 usage
93 fi
102 fi
106 fi
108 ###^^^^^^^^^^^^^^^^^^^^^^^^^###
109 ### Link bootstrap compiler ###
110 ###_________________________###
114 _compiler=
115 _linker=
117 make_stage "$_this/bootstrap/$_host_cpu-cpfront-$_host_system" "$_host_cpu" "cpfront" "$_host_system" -b
118 else
120 fi
121 fi
123 ###^^^^^^^^^^^^^^^^###
124 ### Compile stages ###
125 ###________________###
135 else
142 fi
143 fi
145 ###^^^^^^^^^^^^^^^###
146 ### Cross compile ###
147 ###_______________###
152 fi