Commit | Line | Data |
---|---|---|
50d2bb5b | 1 | configdirs="doc" |
912e0732 RP |
2 | srcname="GDB" |
3 | srctrigger=main.c | |
0df06ca0 RP |
4 | # per-host: |
5 | ||
6c815bbe RP |
6 | # map host info into gdb names. |
7 | ||
8 | case "${host_cpu}" in | |
9 | ||
10 | m68k) | |
11 | case "${host_vendor}" in | |
12 | att) gdb_host=3b1 ;; | |
13 | altos) | |
14 | case "${host_os}" in | |
15 | gas) gdb_host=altosgas ;; | |
16 | *) gdb_host=altos ;; | |
17 | esac | |
18 | ;; | |
afe4ca15 JG |
19 | |
20 | cbm) | |
21 | case ${host_os} in | |
22 | amigados) gdb_host=amigados ;; | |
23 | svr4) gdb_host=amix ;; | |
24 | esac | |
25 | ;; | |
26 | ||
6c815bbe RP |
27 | hp) |
28 | case ${host_os} in | |
29 | hpux) gdb_host=hp300hpux ;; | |
30 | bsd) gdb_host=hp300bsd ;; | |
31 | esac | |
32 | ;; | |
33 | ||
34 | isi) gdb_host=isi ;; | |
35 | sony) gdb_host=news ;; | |
36 | sun) | |
37 | case "${host_os}" in | |
38 | sunos3) gdb_host=sun3os3 ;; | |
39 | sunos4) gdb_host=sun3os4 ;; | |
40 | *) gdb_host=sun3 ;; | |
41 | esac | |
42 | ;; | |
43 | esac | |
44 | ;; | |
45 | ||
46 | m68000) | |
47 | case "${host_vendor}" in | |
48 | sun) | |
49 | case "${host_os}" in | |
50 | sunos3) gdb_host=sun2os3 ;; | |
51 | sunos4) gdb_host=sun2os4 ;; | |
52 | *) gdb_host=sun2 ;; | |
53 | esac | |
54 | esac | |
55 | ;; | |
56 | ||
57 | sparc) | |
58 | case "${host_os}" in | |
59 | sunos3) gdb_host=sun4os3 ;; | |
60 | sunos4) gdb_host=sun4os4 ;; | |
61 | *) gdb_host=sun4 ;; | |
62 | esac | |
63 | ;; | |
64 | ||
65 | m68030) | |
66 | case "${host_vendor}" in | |
67 | sony) gdb_host=news1000 ;; | |
68 | esac | |
69 | ;; | |
70 | ||
71 | mips) | |
72 | case "${host_vendor}" in | |
73 | sony) gdb_host=bigmips ;; | |
5d2cfefe | 74 | dec) gdb_host=decstation ;; |
6c815bbe | 75 | little) gdb_host=littlemips ;; |
625453dc | 76 | sgi) gdb_host=irix3 ;; |
6c815bbe RP |
77 | esac |
78 | ;; | |
79 | ||
80 | i386) | |
81 | case "${host_vendor}" in | |
82 | sun) gdb_host=sun386 ;; | |
83 | sco) gdb_host=i386sco ;; | |
84 | sequent) gdb_host=symmetry ;; | |
85 | *) | |
86 | case "${host_os}" in | |
87 | sysv) gdb_host=i386v ;; | |
88 | sysv32) gdb_host=i386v32 ;; | |
8c6e9f05 | 89 | svr4) gdb_host=i386v4 ;; |
6617b94e | 90 | mach) gdb_host=i386mach ;; |
6c815bbe RP |
91 | esac |
92 | ;; | |
93 | esac | |
94 | ;; | |
95 | ||
96 | c1 | c2) gdb_host=convex ;; | |
97 | ||
98 | ns32k) | |
99 | case "${host_vendor}" in | |
100 | umax) gdb_host=umax ;; | |
101 | esac | |
102 | ;; | |
103 | ||
0476df73 | 104 | romp) |
473f3318 JG |
105 | gdb_host=rtbsd |
106 | ;; | |
107 | ||
b90c4f33 JG |
108 | rs6000) |
109 | gdb_host=rs6000 | |
110 | ;; | |
111 | ||
473f3318 JG |
112 | a29k) |
113 | gdb_host=ultra3 | |
114 | ;; | |
115 | ||
8c7ae4a2 SC |
116 | m88k) |
117 | case "${host_vendor}" in | |
118 | motorola) | |
119 | gdb_host=delta88 ;; | |
120 | *) | |
121 | gdb_host=m88k ;; | |
122 | esac | |
123 | ;; | |
124 | ||
125 | arm | vax | merlin | none | np1 | pn | pyramid | tahoe) | |
473f3318 JG |
126 | gdb_host=${host_cpu} |
127 | ;; | |
6c815bbe RP |
128 | |
129 | ### unhandled hosts | |
130 | #altosgas | |
131 | #i386v-g | |
132 | #i386v32-g | |
133 | ||
134 | esac | |
135 | ||
8c7ae4a2 | 136 | |
3978d059 | 137 | if [ ! -f config/mh-${gdb_host} ]; then |
6c815bbe | 138 | echo '***' "Gdb does not support host ${host}" 1>&2 |
912e0732 RP |
139 | exit 1 |
140 | fi | |
141 | ||
bdf3621b | 142 | # We really shouldn't depend on there being a space after XM_FILE= ... |
3978d059 | 143 | hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <config/mh-${gdb_host}` |
912e0732 | 144 | |
0df06ca0 | 145 | # per-target: |
912e0732 | 146 | |
6c815bbe RP |
147 | case "${target_cpu}" in |
148 | ||
149 | m68k) | |
150 | case "${target_vendor}" in | |
151 | att) gdb_target=3b1 ;; | |
152 | altos) gdb_target=altos ;; | |
afe4ca15 JG |
153 | cbm) |
154 | case ${target_os} in | |
155 | amigados) gdb_host=amigados ;; | |
156 | svr4) gdb_target=amix ;; | |
157 | esac | |
158 | ;; | |
6c815bbe RP |
159 | hp) |
160 | case "${target_os}" in | |
161 | bsd) gdb_target=hp300bsd ;; | |
162 | hpux) gdb_target=hp300hpux ;; | |
163 | esac | |
164 | ;; | |
165 | sun) | |
166 | case "${target_os}" in | |
167 | sunos3) gdb_target=sun3os3 ;; | |
168 | sunos4) gdb_target=sun3os4 ;; | |
169 | *) gdb_target=sun3 ;; | |
170 | esac | |
171 | ;; | |
172 | wrs) gdb_target=vxworks68 ;; | |
173 | isi) gdb_target=isi ;; | |
174 | sony) gdb_target=news ;; | |
175 | esac | |
176 | ;; | |
177 | ||
178 | m68000) | |
179 | case "${target_vendor}" in | |
180 | sun) | |
181 | case "${target_os}" in | |
182 | sunos3) gdb_target=sun2os3 ;; | |
183 | sunos4) gdb_target=sun2os4 ;; | |
184 | *) gdb_target=sun2 ;; | |
185 | esac | |
186 | esac | |
187 | ;; | |
188 | ||
189 | m68030) | |
190 | case "${target_vendor}" in | |
191 | sony) gdb_target=news1000 ;; | |
192 | esac | |
193 | ;; | |
194 | ||
8c7ae4a2 | 195 | none | arm | tahoe | vax | np1 | pn | np1 | pn | pyramid | merlin) |
6c815bbe | 196 | gdb_target=${target_cpu} ;; |
6c815bbe | 197 | |
8c7ae4a2 SC |
198 | m88k) |
199 | case "${target_vendor}" in | |
200 | motorola) gdb_target=delta88 ;; | |
201 | *) gdb_target=dgux ;; | |
202 | esac | |
203 | ;; | |
473f3318 JG |
204 | a29k) |
205 | case "${target_os}" in | |
f74ff50f | 206 | none|aout|coff) gdb_target=a29k ;; |
473f3318 JG |
207 | sym1) gdb_target=ultra3 ;; |
208 | kern) gdb_target=a29k-kern ;; | |
44e4e473 | 209 | ebmon) gdb_target=a29k;; |
473f3318 JG |
210 | esac |
211 | ;; | |
212 | ||
6c815bbe RP |
213 | mips) |
214 | case "${target_vendor}" in | |
215 | sony) gdb_target=bigmips ;; | |
5d2cfefe | 216 | dec) gdb_target=decstation ;; |
6c815bbe | 217 | little) gdb_target=littlemips ;; |
625453dc | 218 | sgi) gdb_target=irix3 ;; |
6c815bbe RP |
219 | esac |
220 | ;; | |
221 | ||
222 | c1 | c2) gdb_target=convex ;; | |
223 | ||
6c815bbe RP |
224 | sparc) |
225 | case "${target_vendor}" in | |
226 | sun) | |
227 | case "${target_os}" in | |
228 | sunos3) gdb_target=sun4os3 ;; | |
229 | sunos4) gdb_target=sun4os4 ;; | |
230 | *) gdb_target=sun4 ;; | |
231 | esac | |
232 | ;; | |
233 | esac | |
234 | ;; | |
235 | ||
236 | ||
237 | i386) | |
238 | case "${target_vendor}" in | |
69e87de2 RP |
239 | sco) gdb_target=i386sco ;; |
240 | sun) gdb_target=sun386 ;; | |
6c815bbe RP |
241 | sequent) gdb_target=symmetry ;; |
242 | *) | |
243 | case "${target_os}" in | |
244 | sysv) gdb_target=i386v ;; | |
245 | sysv32) gdb_target=i386v32 ;; | |
8c6e9f05 | 246 | svr4) gdb_target=i386v4 ;; |
6617b94e | 247 | mach) gdb_target=i386mach ;; |
2b61280a JG |
248 | coff) gdb_target=i386v ;; |
249 | aout) gdb_target=i386aout ;; | |
6c815bbe RP |
250 | esac |
251 | esac | |
252 | ;; | |
253 | ||
254 | i960) | |
255 | case "${target_vendor}" in | |
69e87de2 RP |
256 | bout | wrs) gdb_target=vxworks960 ;; |
257 | coff | intel) gdb_target=nindy960 ;; | |
6c815bbe RP |
258 | esac |
259 | ;; | |
260 | ||
261 | ns32k) | |
262 | case "${target_vendor}" in | |
263 | utek) gdb_target=umax ;; | |
264 | esac | |
265 | ;; | |
266 | ||
b90c4f33 JG |
267 | rs6000) |
268 | gdb_target=rs6000 | |
269 | ;; | |
270 | ||
6c815bbe RP |
271 | ### unhandled targets |
272 | # altosgas | |
273 | # i386v-g | |
274 | # i386v32-g | |
275 | ||
276 | esac | |
277 | ||
3978d059 | 278 | if [ ! -f config/mt-${gdb_target} ]; then |
6c815bbe | 279 | echo '***' "Gdb does not support target ${target}" 1>&2 |
912e0732 RP |
280 | exit 1 |
281 | fi | |
282 | ||
283 | if [ -z "${removing}" ] ; then | |
3978d059 | 284 | cat config/mh-${gdb_host} config/mt-${gdb_target} | awk '$1 == "#msg" { |
912e0732 RP |
285 | print substr($0,6)}' |
286 | fi | |
287 | ||
bdf3621b | 288 | # We really shouldn't depend on there being a space after TM_FILE= ... |
3978d059 | 289 | targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <config/mt-${gdb_target}` |
912e0732 | 290 | |
3978d059 JG |
291 | host_makefile_frag=config/mh-${gdb_host} |
292 | target_makefile_frag=config/mt-${gdb_target} | |
912e0732 | 293 | |
bdf3621b | 294 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the |
dc0c3f64 JG |
295 | # ?config/* file, we don't make the corresponding links. But we have |
296 | # to remove the xm.h files and tm.h files anyway, e.g. when switching | |
297 | # from "configure host" to "configure none". | |
bdf3621b JG |
298 | files= |
299 | links= | |
dc0c3f64 | 300 | rm -f xm.h |
bdf3621b JG |
301 | if [ "${hostfile}" != "" ]; then |
302 | files="${files} ${hostfile}" | |
303 | links="${links} xm.h" | |
304 | fi | |
dc0c3f64 | 305 | rm -f tm.h |
bdf3621b JG |
306 | if [ "${targetfile}" != "" ]; then |
307 | files="${files} ${targetfile}" | |
308 | links="${links} tm.h" | |
309 | fi | |
310 | ||
311 | # post-target: | |
912e0732 | 312 | |
bdf3621b JG |
313 | case ${srcdir} in |
314 | .) | |
315 | ;; | |
316 | *) | |
317 | grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \ | |
318 | echo "source ${srcdir}/.gdbinit" >> .gdbinit | |
319 | esac | |
320 | ||
dc0c3f64 | 321 | cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile |