| 1 | configdirs="doc" |
| 2 | srcname="GDB" |
| 3 | srctrigger=main.c |
| 4 | target_dependent=true |
| 5 | |
| 6 | # per-host: |
| 7 | |
| 8 | # map host info into gdb names. |
| 9 | |
| 10 | case "${host_cpu}" in |
| 11 | |
| 12 | m68k) |
| 13 | case "${host_vendor}" in |
| 14 | apollo*) |
| 15 | case "${host_os}" in |
| 16 | sysv*) gdb_host=apollo68v ;; |
| 17 | esac |
| 18 | ;; |
| 19 | att) gdb_host=3b1 ;; |
| 20 | altos) |
| 21 | case "${host_os}" in |
| 22 | gas) gdb_host=altosgas ;; |
| 23 | *) gdb_host=altos ;; |
| 24 | esac |
| 25 | ;; |
| 26 | |
| 27 | cbm) |
| 28 | case ${host_os} in |
| 29 | amigados) gdb_host=amigados ;; |
| 30 | sysv4*) gdb_host=amix ;; |
| 31 | esac |
| 32 | ;; |
| 33 | |
| 34 | hp) |
| 35 | case ${host_os} in |
| 36 | hpux) gdb_host=hp300hpux ;; |
| 37 | bsd) gdb_host=hp300bsd ;; |
| 38 | esac |
| 39 | ;; |
| 40 | |
| 41 | isi) gdb_host=isi ;; |
| 42 | sony) gdb_host=news ;; |
| 43 | sun) |
| 44 | case "${host_os}" in |
| 45 | sunos3) gdb_host=sun3os3 ;; |
| 46 | sunos4) gdb_host=sun3os4 ;; |
| 47 | *) gdb_host=sun3 ;; |
| 48 | esac |
| 49 | ;; |
| 50 | esac |
| 51 | ;; |
| 52 | |
| 53 | m68000) |
| 54 | case "${host_vendor}" in |
| 55 | sun) |
| 56 | case "${host_os}" in |
| 57 | sunos3) gdb_host=sun2os3 ;; |
| 58 | sunos4) gdb_host=sun2os4 ;; |
| 59 | *) gdb_host=sun2 ;; |
| 60 | esac |
| 61 | esac |
| 62 | ;; |
| 63 | |
| 64 | sparc) |
| 65 | case "${host_os}" in |
| 66 | sunos3) gdb_host=sun4os3 ;; |
| 67 | sunos4) gdb_host=sun4os4 ;; |
| 68 | solaris2*) gdb_host=sun4sol2 ;; |
| 69 | *) gdb_host=sun4 ;; |
| 70 | esac |
| 71 | ;; |
| 72 | |
| 73 | m68030) |
| 74 | case "${host_vendor}" in |
| 75 | sony) gdb_host=news1000 ;; |
| 76 | esac |
| 77 | ;; |
| 78 | |
| 79 | mips) |
| 80 | case "${host_vendor}" in |
| 81 | sony) gdb_host=bigmips ;; |
| 82 | dec) gdb_host=decstation ;; |
| 83 | little) gdb_host=littlemips ;; |
| 84 | sgi) |
| 85 | case "${host_os}" in |
| 86 | irix3) gdb_host=irix3 ;; |
| 87 | irix4) gdb_host=irix4 ;; |
| 88 | esac |
| 89 | ;; |
| 90 | esac |
| 91 | ;; |
| 92 | |
| 93 | i860) |
| 94 | gdb_host=stratus |
| 95 | ;; |
| 96 | |
| 97 | i386) |
| 98 | case "${host_vendor}" in |
| 99 | sun) gdb_host=sun386 ;; |
| 100 | sco) gdb_host=i386sco ;; |
| 101 | sequent) gdb_host=symmetry ;; |
| 102 | ncr) gdb_host=ncr3000 ;; |
| 103 | *) |
| 104 | case "${host_os}" in |
| 105 | go32) gdb_host=go32 ;; |
| 106 | sysv32) gdb_host=i386v32 ;; |
| 107 | sysv4*) gdb_host=i386v4 ;; |
| 108 | sysv*) gdb_host=i386v ;; |
| 109 | scosysv*) gdb_host=i386sco ;; |
| 110 | mach) gdb_host=i386mach ;; |
| 111 | esac |
| 112 | ;; |
| 113 | esac |
| 114 | ;; |
| 115 | |
| 116 | c1 | c2) gdb_host=convex ;; |
| 117 | |
| 118 | ns32k) |
| 119 | case "${host_vendor}" in |
| 120 | umax) gdb_host=umax ;; |
| 121 | esac |
| 122 | ;; |
| 123 | |
| 124 | romp) |
| 125 | gdb_host=rtbsd |
| 126 | ;; |
| 127 | |
| 128 | rs6000) |
| 129 | gdb_host=rs6000 |
| 130 | ;; |
| 131 | |
| 132 | a29k) |
| 133 | gdb_host=ultra3 |
| 134 | ;; |
| 135 | |
| 136 | m88k) |
| 137 | case "${host_vendor}" in |
| 138 | motorola) |
| 139 | gdb_host=delta88 ;; |
| 140 | *) |
| 141 | gdb_host=m88k ;; |
| 142 | esac |
| 143 | ;; |
| 144 | |
| 145 | vax) |
| 146 | case "${host_os}" in |
| 147 | bsd*) |
| 148 | gdb_host=vaxbsd ;; |
| 149 | ultrix*) |
| 150 | gdb_host=vaxult ;; |
| 151 | esac |
| 152 | ;; |
| 153 | |
| 154 | arm | merlin | none | np1 | pn | pyramid | tahoe) |
| 155 | gdb_host=${host_cpu} |
| 156 | ;; |
| 157 | |
| 158 | hppa) |
| 159 | case "${host_vendor}" in |
| 160 | hp) |
| 161 | case "${host_os}" in |
| 162 | hpux) gdb_host=hppahpux ;; |
| 163 | bsd) gdb_host=hppabsd ;; |
| 164 | esac |
| 165 | ;; |
| 166 | esac |
| 167 | ;; |
| 168 | |
| 169 | ### unhandled hosts |
| 170 | #altosgas |
| 171 | #i386v-g |
| 172 | #i386v32-g |
| 173 | |
| 174 | esac |
| 175 | |
| 176 | |
| 177 | if [ ! -f ${srcdir}/config/${gdb_host}.mh ]; then |
| 178 | echo '***' "Gdb does not support host ${host}" 1>&2 |
| 179 | exit 1 |
| 180 | fi |
| 181 | |
| 182 | # We really shouldn't depend on there being a space after XM_FILE= ... |
| 183 | hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <${srcdir}/config/${gdb_host}.mh` |
| 184 | |
| 185 | # per-target: |
| 186 | |
| 187 | case "${target_cpu}" in |
| 188 | |
| 189 | m68k) |
| 190 | case "${target_vendor}" in |
| 191 | att) gdb_target=3b1 ;; |
| 192 | altos) gdb_target=altos ;; |
| 193 | cbm) |
| 194 | case ${target_os} in |
| 195 | amigados) gdb_host=amigados ;; |
| 196 | sysv4*) gdb_target=amix ;; |
| 197 | esac |
| 198 | ;; |
| 199 | hp) |
| 200 | case "${target_os}" in |
| 201 | bsd) gdb_target=hp300bsd ;; |
| 202 | hpux) gdb_target=hp300hpux ;; |
| 203 | esac |
| 204 | ;; |
| 205 | sun) |
| 206 | case "${target_os}" in |
| 207 | sunos3) gdb_target=sun3os3 ;; |
| 208 | sunos4) gdb_target=sun3os4 ;; |
| 209 | *) gdb_target=sun3 ;; |
| 210 | esac |
| 211 | ;; |
| 212 | wrs) gdb_target=vxworks68 ;; |
| 213 | isi) gdb_target=isi ;; |
| 214 | sony) gdb_target=news ;; |
| 215 | esac |
| 216 | case "${target_os}" in |
| 217 | os68k) gdb_target=os68k ;; |
| 218 | esac |
| 219 | ;; |
| 220 | |
| 221 | m68000) |
| 222 | case "${target_vendor}" in |
| 223 | sun) |
| 224 | case "${target_os}" in |
| 225 | sunos3) gdb_target=sun2os3 ;; |
| 226 | sunos4) gdb_target=sun2os4 ;; |
| 227 | *) gdb_target=sun2 ;; |
| 228 | esac |
| 229 | ;; |
| 230 | wrs) gdb_target=vxworks68 ;; |
| 231 | esac |
| 232 | ;; |
| 233 | |
| 234 | m680[124]0) |
| 235 | case "${target_vendor}" in |
| 236 | wrs) gdb_target=vxworks68 ;; |
| 237 | esac |
| 238 | ;; |
| 239 | |
| 240 | m68030) |
| 241 | case "${target_vendor}" in |
| 242 | sony) gdb_target=news1000 ;; |
| 243 | wrs) gdb_target=vxworks68 ;; |
| 244 | esac |
| 245 | ;; |
| 246 | |
| 247 | m68kmote) |
| 248 | case "${target_vendor}" in |
| 249 | tandem) gdb_target=st2000 ;; |
| 250 | esac |
| 251 | ;; |
| 252 | |
| 253 | none | arm | tahoe | vax | np1 | pn | np1 | pn | pyramid | merlin) |
| 254 | gdb_target=${target_cpu} ;; |
| 255 | |
| 256 | m88k) |
| 257 | case "${target_vendor}" in |
| 258 | motorola) gdb_target=delta88 ;; |
| 259 | *) gdb_target=dgux ;; |
| 260 | esac |
| 261 | ;; |
| 262 | a29k) |
| 263 | case "${target_os}" in |
| 264 | none|aout|coff) gdb_target=a29k ;; |
| 265 | sym1) gdb_target=ultra3 ;; |
| 266 | kern) gdb_target=a29k-kern ;; |
| 267 | ebmon) gdb_target=a29k;; |
| 268 | udi) gdb_target=a29k-udi;; |
| 269 | esac |
| 270 | ;; |
| 271 | |
| 272 | mips) |
| 273 | case "${target_vendor}" in |
| 274 | sony) gdb_target=bigmips ;; |
| 275 | big) gdb_target=bigmips ;; |
| 276 | dec) gdb_target=decstation ;; |
| 277 | little) gdb_target=littlemips ;; |
| 278 | sgi) gdb_target=irix3 ;; |
| 279 | esac |
| 280 | ;; |
| 281 | |
| 282 | c1 | c2) gdb_target=convex ;; |
| 283 | |
| 284 | sparc) |
| 285 | case "${target_vendor}" in |
| 286 | sun) |
| 287 | case "${target_os}" in |
| 288 | sunos3) gdb_target=sun4os3 ;; |
| 289 | sunos4) gdb_target=sun4os4 ;; |
| 290 | solaris2*) gdb_target=sun4sol2 ;; |
| 291 | *) gdb_target=sun4 ;; |
| 292 | esac |
| 293 | ;; |
| 294 | esac |
| 295 | ;; |
| 296 | |
| 297 | h8300) |
| 298 | gdb_target=h8300hms |
| 299 | ;; |
| 300 | |
| 301 | i860) gdb_target=stratus |
| 302 | ;; |
| 303 | |
| 304 | i386) |
| 305 | case "${target_vendor}" in |
| 306 | sco) gdb_target=i386sco ;; |
| 307 | sun) gdb_target=sun386 ;; |
| 308 | sequent) gdb_target=symmetry ;; |
| 309 | ncr) gdb_target=ncr3000 ;; |
| 310 | *) |
| 311 | case "${target_os}" in |
| 312 | sysv32) gdb_target=i386v32 ;; |
| 313 | scosysv3*) gdb_target=i386v32 ;; |
| 314 | sysv4*) gdb_target=i386v4 ;; |
| 315 | sysv*) gdb_target=i386v ;; |
| 316 | mach) gdb_target=i386mach ;; |
| 317 | coff) gdb_target=i386v ;; |
| 318 | aout) gdb_target=i386aout ;; |
| 319 | esac |
| 320 | esac |
| 321 | ;; |
| 322 | |
| 323 | i960) |
| 324 | case "${target_vendor}" in |
| 325 | bout | wrs) gdb_target=vxworks960 ;; |
| 326 | coff | intel) gdb_target=nindy960 ;; |
| 327 | esac |
| 328 | ;; |
| 329 | |
| 330 | ns32k) |
| 331 | case "${target_vendor}" in |
| 332 | utek) gdb_target=umax ;; |
| 333 | esac |
| 334 | ;; |
| 335 | |
| 336 | rs6000) |
| 337 | gdb_target=rs6000 |
| 338 | ;; |
| 339 | |
| 340 | hppa) |
| 341 | case "${target_vendor}" in |
| 342 | hp) |
| 343 | case "${target_os}" in |
| 344 | hpux) gdb_target=hppahpux ;; |
| 345 | bsd) gdb_target=hppabsd ;; |
| 346 | esac |
| 347 | ;; |
| 348 | esac |
| 349 | ;; |
| 350 | |
| 351 | ### unhandled targets |
| 352 | # altosgas |
| 353 | # i386v-g |
| 354 | # i386v32-g |
| 355 | |
| 356 | esac |
| 357 | |
| 358 | if [ ! -f ${srcdir}/config/${gdb_target}.mt ]; then |
| 359 | echo '***' "Gdb does not support target ${target}" 1>&2 |
| 360 | exit 1 |
| 361 | fi |
| 362 | |
| 363 | if [ -z "${removing}" ] ; then |
| 364 | cat ${srcdir}/config/${gdb_host}.mh ${srcdir}/config/${gdb_target}.mt | awk '$1 == "#msg" { |
| 365 | print substr($0,6)}' |
| 366 | fi |
| 367 | |
| 368 | # We really shouldn't depend on there being a space after TM_FILE= ... |
| 369 | targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <${srcdir}/config/${gdb_target}.mt` |
| 370 | |
| 371 | host_makefile_frag=config/${gdb_host}.mh |
| 372 | target_makefile_frag=config/${gdb_target}.mt |
| 373 | |
| 374 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the |
| 375 | # ?config/* file, we don't make the corresponding links. But we have |
| 376 | # to remove the xm.h files and tm.h files anyway, e.g. when switching |
| 377 | # from "configure host" to "configure none". |
| 378 | files= |
| 379 | links= |
| 380 | rm -f xm.h |
| 381 | if [ "${hostfile}" != "" ]; then |
| 382 | files="${files} ${hostfile}" |
| 383 | links="${links} xm.h" |
| 384 | fi |
| 385 | rm -f tm.h |
| 386 | if [ "${targetfile}" != "" ]; then |
| 387 | files="${files} ${targetfile}" |
| 388 | links="${links} tm.h" |
| 389 | fi |
| 390 | |
| 391 | # post-target: |
| 392 | |
| 393 | case ${srcdir} in |
| 394 | .) |
| 395 | ;; |
| 396 | *) |
| 397 | grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \ |
| 398 | echo "source ${srcdir}/.gdbinit" >> .gdbinit |
| 399 | esac |
| 400 | |
| 401 | cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile |