Commit | Line | Data |
---|---|---|
5db7ecb7 SS |
1 | # Top-level script fragment to build everything for MPW. |
2 | ||
3 | Set savedir "`Directory`" | |
4 | ||
5 | #Set Echo 1 | |
6 | ||
aa8f28af | 7 | Set ThisScript "{0}" |
5db7ecb7 SS |
8 | |
9 | Set objdir ":" | |
10 | ||
11 | Set verify 0 | |
5db7ecb7 SS |
12 | |
13 | Set BuildTarget "none" | |
14 | ||
5db7ecb7 SS |
15 | # Parse arguments. |
16 | ||
17 | Loop | |
18 | Break If {#} == 0 | |
5db7ecb7 SS |
19 | If "{BuildTarget}" =~ /none/ |
20 | Set BuildTarget "{1}" | |
21 | Else | |
22 | Echo Only one build target allowed, ignoring "{1}" | |
23 | End If | |
5db7ecb7 SS |
24 | Shift 1 |
25 | End Loop | |
26 | ||
1e490350 JL |
27 | If "{BuildTarget}" =~ /none/ |
28 | Set BuildTarget "all" | |
29 | End If | |
30 | ||
aa8f28af SS |
31 | If {verify} == 1 |
32 | Echo "#" Doing "{ThisScript}" "{BuildTarget}" in "`Directory`" ... | |
33 | End If | |
34 | ||
1e490350 JL |
35 | Set ranmake 0 |
36 | ||
aa8f28af SS |
37 | If "`Exists Makefile`" != "" |
38 | Echo "Set Echo 1" >{BuildTarget}.makeout | |
39 | Make -f Makefile {BuildTarget} >>{BuildTarget}.makeout | |
40 | {BuildTarget}.makeout | |
41 | Delete {BuildTarget}.makeout | |
1e490350 JL |
42 | Set ranmake 1 |
43 | End If | |
44 | ||
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 | |
50 | Set ranmake 1 | |
51 | End If | |
52 | ||
53 | If {ranmake} == 1 | |
54 | Exit | |
55 | End If | |
56 | ||
57 | # Dispatch on various pseudo-targets. | |
58 | ||
59 | If "{BuildTarget}" =~ /all/ | |
60 | Echo Started `Date` | |
aa8f28af | 61 | "{ThisScript}" all-gcc |
aa8f28af | 62 | "{ThisScript}" all-gdb |
1e490350 JL |
63 | Echo Finished `Date` |
64 | Else If "{BuildTarget}" =~ /all-libiberty/ | |
aa8f28af | 65 | "{ThisScript}" do-libiberty |
1e490350 | 66 | Else If "{BuildTarget}" =~ /all-bfd/ |
aa8f28af | 67 | "{ThisScript}" do-bfd |
1e490350 | 68 | Else If "{BuildTarget}" =~ /all-opcodes/ |
aa8f28af | 69 | "{ThisScript}" do-opcodes |
1e490350 JL |
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 | |
aa8f28af | 79 | "{ThisScript}" do-binutils |
5db7ecb7 | 80 | Else If "{BuildTarget}" =~ /all-gas/ |
1e490350 JL |
81 | "{ThisScript}" all-libiberty |
82 | "{ThisScript}" all-bfd | |
83 | "{ThisScript}" all-opcodes | |
aa8f28af | 84 | "{ThisScript}" do-gas |
5db7ecb7 | 85 | Else If "{BuildTarget}" =~ /all-gcc/ |
1e490350 | 86 | "{ThisScript}" all-libiberty |
aa8f28af SS |
87 | "{ThisScript}" all-gas |
88 | "{ThisScript}" all-binutils | |
1e490350 | 89 | "{ThisScript}" all-ld |
aa8f28af | 90 | "{ThisScript}" do-gcc |
5db7ecb7 | 91 | Else If "{BuildTarget}" =~ /all-gdb/ |
1e490350 JL |
92 | "{ThisScript}" all-libiberty |
93 | "{ThisScript}" all-bfd | |
94 | "{ThisScript}" all-opcodes | |
aa8f28af | 95 | "{ThisScript}" do-gdb |
1e490350 JL |
96 | Else If "{BuildTarget}" =~ /all-grez/ |
97 | "{ThisScript}" all-libiberty | |
98 | "{ThisScript}" all-bfd | |
99 | "{ThisScript}" do-grez | |
5db7ecb7 | 100 | Else If "{BuildTarget}" =~ /all-ld/ |
1e490350 JL |
101 | "{ThisScript}" all-libiberty |
102 | "{ThisScript}" all-bfd | |
103 | "{ThisScript}" all-opcodes | |
aa8f28af | 104 | "{ThisScript}" do-ld |
1e490350 JL |
105 | Else If "{BuildTarget}" =~ /do-byacc/ |
106 | SetDirectory :byacc: | |
107 | ::mpw-build all | |
108 | Else If "{BuildTarget}" =~ /do-flex/ | |
109 | SetDirectory :flex: | |
110 | ::mpw-build _bootstrap | |
111 | ::mpw-build all | |
5db7ecb7 SS |
112 | Else If "{BuildTarget}" =~ /do-bfd/ |
113 | SetDirectory :bfd: | |
aa8f28af | 114 | ::mpw-build all |
5db7ecb7 SS |
115 | Else If "{BuildTarget}" =~ /do-libiberty/ |
116 | SetDirectory :libiberty: | |
aa8f28af | 117 | ::mpw-build all |
5db7ecb7 SS |
118 | Else If "{BuildTarget}" =~ /do-opcodes/ |
119 | SetDirectory :opcodes: | |
aa8f28af | 120 | ::mpw-build all |
5db7ecb7 SS |
121 | Else If "{BuildTarget}" =~ /do-binutils/ |
122 | SetDirectory :binutils: | |
1e490350 | 123 | ::mpw-build stamps |
aa8f28af | 124 | ::mpw-build all |
5db7ecb7 SS |
125 | Else If "{BuildTarget}" =~ /do-gas/ |
126 | SetDirectory :gas: | |
1e490350 | 127 | ::mpw-build stamps |
aa8f28af | 128 | ::mpw-build all |
5db7ecb7 SS |
129 | Else If "{BuildTarget}" =~ /do-gcc/ |
130 | SetDirectory :gcc: | |
1e490350 | 131 | :mpw-build all |
5db7ecb7 SS |
132 | Else If "{BuildTarget}" =~ /do-gdb/ |
133 | SetDirectory :gdb: | |
aa8f28af | 134 | ::mpw-build all |
1e490350 JL |
135 | Else If "{BuildTarget}" =~ /do-grez/ |
136 | SetDirectory :grez: | |
137 | ::mpw-build all | |
5db7ecb7 SS |
138 | Else If "{BuildTarget}" =~ /do-ld/ |
139 | SetDirectory :ld: | |
aa8f28af | 140 | ::mpw-build all |
1e490350 JL |
141 | Else If "{BuildTarget}" =~ /do-newlib/ |
142 | SetDirectory :newlib: | |
143 | ::mpw-build all | |
5db7ecb7 | 144 | Else If "{BuildTarget}" =~ /install/ |
1e490350 | 145 | "{ThisScript}" install-only-top |
aa8f28af SS |
146 | "{ThisScript}" install-binutils |
147 | "{ThisScript}" install-gas | |
148 | "{ThisScript}" install-gcc | |
aa8f28af | 149 | "{ThisScript}" install-ld |
1e490350 | 150 | "{ThisScript}" install-gdb |
5db7ecb7 SS |
151 | Else If "{BuildTarget}" =~ /install-binutils/ |
152 | SetDirectory :binutils: | |
aa8f28af | 153 | ::mpw-build install |
5db7ecb7 SS |
154 | Else If "{BuildTarget}" =~ /install-gas/ |
155 | SetDirectory :gas: | |
aa8f28af | 156 | ::mpw-build install |
5db7ecb7 SS |
157 | Else If "{BuildTarget}" =~ /install-gcc/ |
158 | SetDirectory :gcc: | |
1e490350 | 159 | :mpw-build install |
5db7ecb7 SS |
160 | Else If "{BuildTarget}" =~ /install-gdb/ |
161 | SetDirectory :gdb: | |
aa8f28af | 162 | ::mpw-build install |
1e490350 JL |
163 | Else If "{BuildTarget}" =~ /install-grez/ |
164 | SetDirectory :grez: | |
165 | ::mpw-build install | |
5db7ecb7 SS |
166 | Else If "{BuildTarget}" =~ /install-ld/ |
167 | SetDirectory :ld: | |
aa8f28af | 168 | ::mpw-build install |
1e490350 JL |
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/ | |
180 | SetDirectory :gas: | |
181 | ::mpw-build install-only | |
182 | Else If "{BuildTarget}" =~ /install-only-gcc/ | |
183 | SetDirectory :gcc: | |
184 | :mpw-build install-only | |
185 | Else If "{BuildTarget}" =~ /install-only-gdb/ | |
186 | SetDirectory :gdb: | |
187 | ::mpw-build install-only | |
188 | Else If "{BuildTarget}" =~ /install-only-grez/ | |
189 | SetDirectory :grez: | |
190 | ::mpw-build install-only | |
191 | Else If "{BuildTarget}" =~ /install-only-ld/ | |
192 | SetDirectory :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 | |
199 | End If | |
5db7ecb7 | 200 | Else |
1e490350 | 201 | Echo {BuildTarget} not understood, ignoring |
5db7ecb7 SS |
202 | End If |
203 | ||
204 | SetDirectory "{savedir}" |