| 1 | srcname="GDB" |
| 2 | srctrigger=main.c |
| 3 | |
| 4 | # per-host: |
| 5 | |
| 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 | ;; |
| 19 | hp) |
| 20 | case ${host_os} in |
| 21 | hpux) gdb_host=hp300hpux ;; |
| 22 | bsd) gdb_host=hp300bsd ;; |
| 23 | esac |
| 24 | ;; |
| 25 | |
| 26 | isi) gdb_host=isi ;; |
| 27 | sony) gdb_host=news ;; |
| 28 | sun) |
| 29 | case "${host_os}" in |
| 30 | sunos3) gdb_host=sun3os3 ;; |
| 31 | sunos4) gdb_host=sun3os4 ;; |
| 32 | *) gdb_host=sun3 ;; |
| 33 | esac |
| 34 | ;; |
| 35 | esac |
| 36 | ;; |
| 37 | |
| 38 | m68000) |
| 39 | case "${host_vendor}" in |
| 40 | sun) |
| 41 | case "${host_os}" in |
| 42 | sunos3) gdb_host=sun2os3 ;; |
| 43 | sunos4) gdb_host=sun2os4 ;; |
| 44 | *) gdb_host=sun2 ;; |
| 45 | esac |
| 46 | esac |
| 47 | ;; |
| 48 | |
| 49 | sparc) |
| 50 | case "${host_os}" in |
| 51 | sunos3) gdb_host=sun4os3 ;; |
| 52 | sunos4) gdb_host=sun4os4 ;; |
| 53 | *) gdb_host=sun4 ;; |
| 54 | esac |
| 55 | ;; |
| 56 | |
| 57 | m68030) |
| 58 | case "${host_vendor}" in |
| 59 | sony) gdb_host=news1000 ;; |
| 60 | esac |
| 61 | ;; |
| 62 | |
| 63 | mips) |
| 64 | case "${host_vendor}" in |
| 65 | sony) gdb_host=bigmips ;; |
| 66 | dec) gdb_host=dec3100 ;; |
| 67 | little) gdb_host=littlemips ;; |
| 68 | esac |
| 69 | ;; |
| 70 | |
| 71 | i386) |
| 72 | case "${host_vendor}" in |
| 73 | sun) gdb_host=sun386 ;; |
| 74 | sco) gdb_host=i386sco ;; |
| 75 | sequent) gdb_host=symmetry ;; |
| 76 | *) |
| 77 | case "${host_os}" in |
| 78 | sysv) gdb_host=i386v ;; |
| 79 | sysv32) gdb_host=i386v32 ;; |
| 80 | esac |
| 81 | ;; |
| 82 | esac |
| 83 | ;; |
| 84 | |
| 85 | c1 | c2) gdb_host=convex ;; |
| 86 | |
| 87 | ns32k) |
| 88 | case "${host_vendor}" in |
| 89 | umax) gdb_host=umax ;; |
| 90 | esac |
| 91 | ;; |
| 92 | |
| 93 | arm | vax | m88k | merlin | none | np1 | pn | pyramid | tahoe) gdb_host=${host_cpu} ;; |
| 94 | |
| 95 | ### unhandled hosts |
| 96 | #altosgas |
| 97 | #i386v-g |
| 98 | #i386v32-g |
| 99 | |
| 100 | esac |
| 101 | |
| 102 | if [ ! -f xconfig/${gdb_host} ]; then |
| 103 | echo '***' "Gdb does not support host ${host}" 1>&2 |
| 104 | exit 1 |
| 105 | fi |
| 106 | |
| 107 | # We really shouldn't depend on there being a space after XM_FILE= ... |
| 108 | hostfile=`awk '$1 == "XM_FILE=" { print $2 }' <xconfig/${gdb_host}` |
| 109 | |
| 110 | # per-target: |
| 111 | |
| 112 | case "${target_cpu}" in |
| 113 | |
| 114 | m68k) |
| 115 | case "${target_vendor}" in |
| 116 | att) gdb_target=3b1 ;; |
| 117 | altos) gdb_target=altos ;; |
| 118 | hp) |
| 119 | case "${target_os}" in |
| 120 | bsd) gdb_target=hp300bsd ;; |
| 121 | hpux) gdb_target=hp300hpux ;; |
| 122 | esac |
| 123 | ;; |
| 124 | sun) |
| 125 | case "${target_os}" in |
| 126 | sunos3) gdb_target=sun3os3 ;; |
| 127 | sunos4) gdb_target=sun3os4 ;; |
| 128 | *) gdb_target=sun3 ;; |
| 129 | esac |
| 130 | ;; |
| 131 | wrs) gdb_target=vxworks68 ;; |
| 132 | isi) gdb_target=isi ;; |
| 133 | sony) gdb_target=news ;; |
| 134 | esac |
| 135 | ;; |
| 136 | |
| 137 | m68000) |
| 138 | case "${target_vendor}" in |
| 139 | sun) |
| 140 | case "${target_os}" in |
| 141 | sunos3) gdb_target=sun2os3 ;; |
| 142 | sunos4) gdb_target=sun2os4 ;; |
| 143 | *) gdb_target=sun2 ;; |
| 144 | esac |
| 145 | esac |
| 146 | ;; |
| 147 | |
| 148 | m68030) |
| 149 | case "${target_vendor}" in |
| 150 | sony) gdb_target=news1000 ;; |
| 151 | esac |
| 152 | ;; |
| 153 | |
| 154 | none | tahoe | vax | np1 | pn | np1 | pn | pyramid | merlin | m88k) |
| 155 | gdb_target=${target_cpu} ;; |
| 156 | a29k) gdb_target=am29k ;; |
| 157 | arm) gdb_target=${target_cpu} ;; |
| 158 | |
| 159 | mips) |
| 160 | case "${target_vendor}" in |
| 161 | sony) gdb_target=bigmips ;; |
| 162 | dec) gdb_target=dec3100 ;; |
| 163 | little) gdb_target=littlemips ;; |
| 164 | esac |
| 165 | ;; |
| 166 | |
| 167 | c1 | c2) gdb_target=convex ;; |
| 168 | |
| 169 | sparc) |
| 170 | case "${target_vendor}" in |
| 171 | sun) |
| 172 | case "${target_os}" in |
| 173 | sunos3) gdb_target=sun4os3 ;; |
| 174 | sunos4) gdb_target=sun4os4 ;; |
| 175 | *) gdb_target=sun4 ;; |
| 176 | esac |
| 177 | ;; |
| 178 | esac |
| 179 | ;; |
| 180 | |
| 181 | |
| 182 | i386) |
| 183 | case "${target_vendor}" in |
| 184 | sco) gdb_target=i386sco ;; |
| 185 | sun) gdb_target=sun386 ;; |
| 186 | sequent) gdb_target=symmetry ;; |
| 187 | coff) gdb_target=i386v ;; |
| 188 | aout) gdb_target=i386v ;; |
| 189 | *) |
| 190 | case "${target_os}" in |
| 191 | sysv) gdb_target=i386v ;; |
| 192 | sysv32) gdb_target=i386v32 ;; |
| 193 | esac |
| 194 | esac |
| 195 | ;; |
| 196 | |
| 197 | i960) |
| 198 | case "${target_vendor}" in |
| 199 | bout | wrs) gdb_target=vxworks960 ;; |
| 200 | coff | intel) gdb_target=nindy960 ;; |
| 201 | esac |
| 202 | ;; |
| 203 | |
| 204 | ns32k) |
| 205 | case "${target_vendor}" in |
| 206 | utek) gdb_target=umax ;; |
| 207 | esac |
| 208 | ;; |
| 209 | |
| 210 | ### unhandled targets |
| 211 | # altosgas |
| 212 | # i386v-g |
| 213 | # i386v32-g |
| 214 | |
| 215 | esac |
| 216 | |
| 217 | if [ ! -f tconfig/${gdb_target} ]; then |
| 218 | echo '***' "Gdb does not support target ${target}" 1>&2 |
| 219 | exit 1 |
| 220 | fi |
| 221 | |
| 222 | if [ -z "${removing}" ] ; then |
| 223 | cat xconfig/${gdb_host} tconfig/${gdb_target} | awk '$1 == "#msg" { |
| 224 | print substr($0,6)}' |
| 225 | fi |
| 226 | |
| 227 | # We really shouldn't depend on there being a space after TM_FILE= ... |
| 228 | targetfile=`awk '$1 == "TM_FILE=" { print $2 }' <tconfig/${gdb_target}` |
| 229 | |
| 230 | host_makefile_frag=xconfig/${gdb_host} |
| 231 | target_makefile_frag=tconfig/${gdb_target} |
| 232 | |
| 233 | # If hostfile (XM_FILE) and/or targetfile (TM_FILE) is not set in the |
| 234 | # ?config/* file, we don't make the corresponding links. But we have |
| 235 | # to remove the xm.h files and tm.h files anyway, e.g. when switching |
| 236 | # from "configure host" to "configure none". |
| 237 | files= |
| 238 | links= |
| 239 | rm -f xm.h |
| 240 | if [ "${hostfile}" != "" ]; then |
| 241 | files="${files} ${hostfile}" |
| 242 | links="${links} xm.h" |
| 243 | fi |
| 244 | rm -f tm.h |
| 245 | if [ "${targetfile}" != "" ]; then |
| 246 | files="${files} ${targetfile}" |
| 247 | links="${links} tm.h" |
| 248 | fi |
| 249 | |
| 250 | # post-target: |
| 251 | |
| 252 | case ${srcdir} in |
| 253 | .) |
| 254 | ;; |
| 255 | *) |
| 256 | grep -s "source ${srcdir}/.gdbinit" .gdbinit 2>/dev/null || \ |
| 257 | echo "source ${srcdir}/.gdbinit" >> .gdbinit |
| 258 | esac |
| 259 | |
| 260 | cat ${srcdir}/alldeps.mak ${srcdir}/depend >>Makefile |