1 # Top-level script fragment to build everything for MPW.
3 Set savedir "`Directory`"
13 Set BuildTarget "none"
19 If "{BuildTarget}" =~ /none/
22 Echo Only one build target allowed, ignoring "{1}"
27 If "{BuildTarget}" =~ /none/
32 Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ...
37 If "`Exists Makefile`" != ""
38 Echo "Set Echo 1" >{BuildTarget}.makeout
39 Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout
41 Delete {BuildTarget}.makeout
45 If "`Exists Makefile.PPC`" != ""
46 Echo "Set Echo 1" >{BuildTarget}.makeout.ppc
47 Make -f Makefile.PPC {BuildTarget} >>{BuildTarget}.makeout.ppc
48 {BuildTarget}.makeout.ppc
49 Delete {BuildTarget}.makeout.ppc
57 # Dispatch on various pseudo-targets.
59 If "{BuildTarget}" =~ /all/
61 "{ThisScript}" all-gcc
62 "{ThisScript}" all-gdb
64 Else If "{BuildTarget}" =~ /all-libiberty/
65 "{ThisScript}" do-libiberty
66 Else If "{BuildTarget}" =~ /all-bfd/
68 Else If "{BuildTarget}" =~ /all-opcodes/
69 "{ThisScript}" do-opcodes
70 Else If "{BuildTarget}" =~ /all-byacc/
71 "{ThisScript}" do-byacc
72 Else If "{BuildTarget}" =~ /all-flex/
73 "{ThisScript}" all-libiberty
74 "{ThisScript}" do-flex
75 Else If "{BuildTarget}" =~ /all-binutils/
76 "{ThisScript}" all-libiberty
77 "{ThisScript}" all-bfd
78 "{ThisScript}" all-opcodes
79 "{ThisScript}" do-binutils
80 Else If "{BuildTarget}" =~ /all-gas/
81 "{ThisScript}" all-libiberty
82 "{ThisScript}" all-bfd
83 "{ThisScript}" all-opcodes
85 Else If "{BuildTarget}" =~ /all-gcc/
86 "{ThisScript}" all-libiberty
87 "{ThisScript}" all-gas
88 "{ThisScript}" all-binutils
91 Else If "{BuildTarget}" =~ /all-gdb/
92 "{ThisScript}" all-libiberty
93 "{ThisScript}" all-bfd
94 "{ThisScript}" all-opcodes
96 Else If "{BuildTarget}" =~ /all-grez/
97 "{ThisScript}" all-libiberty
98 "{ThisScript}" all-bfd
99 "{ThisScript}" do-grez
100 Else If "{BuildTarget}" =~ /all-ld/
101 "{ThisScript}" all-libiberty
102 "{ThisScript}" all-bfd
103 "{ThisScript}" all-opcodes
105 Else If "{BuildTarget}" =~ /do-byacc/
108 Else If "{BuildTarget}" =~ /do-flex/
110 ::mpw-build _bootstrap
112 Else If "{BuildTarget}" =~ /do-bfd/
115 Else If "{BuildTarget}" =~ /do-libiberty/
116 SetDirectory :libiberty:
118 Else If "{BuildTarget}" =~ /do-opcodes/
119 SetDirectory :opcodes:
121 Else If "{BuildTarget}" =~ /do-binutils/
122 SetDirectory :binutils:
125 Else If "{BuildTarget}" =~ /do-gas/
129 Else If "{BuildTarget}" =~ /do-gcc/
132 Else If "{BuildTarget}" =~ /do-gdb/
135 Else If "{BuildTarget}" =~ /do-grez/
138 Else If "{BuildTarget}" =~ /do-ld/
141 Else If "{BuildTarget}" =~ /do-newlib/
142 SetDirectory :newlib:
144 Else If "{BuildTarget}" =~ /install/
145 "{ThisScript}" install-only-top
146 "{ThisScript}" install-binutils
147 "{ThisScript}" install-gas
148 "{ThisScript}" install-gcc
149 "{ThisScript}" install-ld
150 "{ThisScript}" install-gdb
151 Else If "{BuildTarget}" =~ /install-binutils/
152 SetDirectory :binutils:
154 Else If "{BuildTarget}" =~ /install-gas/
157 Else If "{BuildTarget}" =~ /install-gcc/
160 Else If "{BuildTarget}" =~ /install-gdb/
163 Else If "{BuildTarget}" =~ /install-grez/
166 Else If "{BuildTarget}" =~ /install-ld/
169 Else If "{BuildTarget}" =~ /install-only/
170 "{ThisScript}" install-only-top
171 "{ThisScript}" install-only-binutils
172 "{ThisScript}" install-only-gas
173 "{ThisScript}" install-only-gcc
174 "{ThisScript}" install-only-gdb
175 "{ThisScript}" install-only-ld
176 Else If "{BuildTarget}" =~ /install-only-binutils/
177 SetDirectory :binutils:
178 ::mpw-build install-only
179 Else If "{BuildTarget}" =~ /install-only-gas/
181 ::mpw-build install-only
182 Else If "{BuildTarget}" =~ /install-only-gcc/
184 :mpw-build install-only
185 Else If "{BuildTarget}" =~ /install-only-gdb/
187 ::mpw-build install-only
188 Else If "{BuildTarget}" =~ /install-only-grez/
190 ::mpw-build install-only
191 Else If "{BuildTarget}" =~ /install-only-ld/
193 ::mpw-build install-only
194 Else If "{BuildTarget}" =~ /install-only-top/
195 NewFolderRecursive "{prefix}"
196 If "{prefix}" != "`Directory`"
197 Duplicate -y 'Read Me for MPW' "{prefix}"'Read Me for MPW'
198 Duplicate -y Install "{prefix}"Install
201 Echo {BuildTarget} not understood, ignoring
204 SetDirectory "{savedir}"