aboutsummaryrefslogtreecommitdiff
path: root/opcodes
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1995-09-27 01:53:07 +0000
committerStan Shebs <shebs@codesourcery.com>1995-09-27 01:53:07 +0000
commitcf9dcb11d0104d9036d242ba6533be2d03b7fa2c (patch)
tree5c125362b664dffb00cb5399803ae2b4a798905a /opcodes
parenta2e7268980ab302aa6521154147b4c1cd8dd2cdb (diff)
downloadgdb-cf9dcb11d0104d9036d242ba6533be2d03b7fa2c.zip
gdb-cf9dcb11d0104d9036d242ba6533be2d03b7fa2c.tar.gz
gdb-cf9dcb11d0104d9036d242ba6533be2d03b7fa2c.tar.bz2
* mpw-config.in: Add m68k-opc.c.o to BFD_MACHINES for m68k,
no longer create sysdep.h, sed ppc-opc.c to work around a serious Metrowerks C bug. * mpw-make.in: Remove. * mpw-make.sed: New file, used by mpw-configure to edit Makefile.in into an MPW makefile.
Diffstat (limited to 'opcodes')
-rw-r--r--opcodes/mpw-config.in69
-rw-r--r--opcodes/mpw-make.in172
-rw-r--r--opcodes/mpw-make.sed14
3 files changed, 75 insertions, 180 deletions
diff --git a/opcodes/mpw-config.in b/opcodes/mpw-config.in
index 425a6d0..5043f90 100644
--- a/opcodes/mpw-config.in
+++ b/opcodes/mpw-config.in
@@ -1,15 +1,13 @@
# Configuration fragment for opcodes.
-forward-include "{srcroot}"bfd:hosts:mpw.h sysdep.h
-
Set target_arch `echo {target_canonical} | sed -e 's/-.*-.*//'`
Set archname ARCH_{target_arch}
If "{target_arch}" =~ /m68k/
- Set BFD_MACHINES '"{o}"m68k-dis.c.o'
+ Set BFD_MACHINES '"{o}"m68k-dis.c.o "{o}"m68k-opc.c.o'
Else If "{target_arch}" =~ /powerpc/
- Set BFD_MACHINES '"{o}"ppc-dis.c.o "{o}"ppc-opc.c.o'
+ Set BFD_MACHINES '"{o}"ppc-dis.c.o "{o}"hacked_ppc-opc.c.o'
Else If "{target_arch}" =~ /i386/
Set BFD_MACHINES '"{o}"i386-dis.c.o'
Else If "{target_arch}" =~ /mips/
@@ -18,10 +16,65 @@ Else If "{target_arch}" =~ /sh/
Set BFD_MACHINES '"{o}"sh-dis.c.o'
End If
-Echo '# Start from mpw-config.in' > "{o}"mk.tmp
+Echo '# Start from mpw-config.in' > "{o}"mk.tmp
+Echo "BFD_MACHINES = " {BFD_MACHINES} >> "{o}"mk.tmp
+Echo "ARCHDEFS = -d" {archname} >> "{o}"mk.tmp
+Echo '# End from mpw-config.in' >> "{o}"mk.tmp
+
+Echo '/* config.h. Generated by mpw-configure. */' > "{o}"config.new
+Echo '#include "mpw.h"' >> "{o}"config.new
-Echo "BFD_MACHINES = " {BFD_MACHINES} >> "{o}"mk.tmp
+MoveIfChange "{o}"config.new "{o}"config.h
-Echo "ARCHDEFS = -d" {archname} >> "{o}"mk.tmp
+# Work around a deadly Metrowerks C for PPC bug (kills the Mac).
-Echo '# End from mpw-config.in' >> "{o}"mk.tmp
+sed -e '/UNUSED/s/(UNUSED + 1)/(1)/' \Option-d
+ -e '/BA/s/(BA + 1)/(2)/' \Option-d
+ -e '/BAT/s/(BAT + 1)/(3)/' \Option-d
+ -e '/BB/s/(BB + 1)/(4)/' \Option-d
+ -e '/BBA/s/(BBA + 1)/(5)/' \Option-d
+ -e '/BD/s/(BD + 1)/(6)/' \Option-d
+ -e '/BDA/s/(BDA + 1)/(7)/' \Option-d
+ -e '/BDM/s/(BDM + 1)/(8)/' \Option-d
+ -e '/BDMA/s/(BDMA + 1)/(9)/' \Option-d
+ -e '/BDP/s/(BDP + 1)/(10)/' \Option-d
+ -e '/BDPA/s/(BDPA + 1)/(11)/' \Option-d
+ -e '/BF/s/(BF + 1)/(12)/' \Option-d
+ -e '/OBF/s/(OBF + 1)/(13)/' \Option-d
+ -e '/BFA/s/(BFA + 1)/(14)/' \Option-d
+ -e '/BI/s/(BI + 1)/(15)/' \Option-d
+ -e '/BO/s/(BO + 1)/(16)/' \Option-d
+ -e '/BOE/s/(BOE + 1)/(17)/' \Option-d
+ -e '/BT/s/(BT + 1)/(18)/' \Option-d
+ -e '/CR/s/(CR + 1)/(19)/' \Option-d
+ -e '/D/s/(D + 1)/(20)/' \Option-d
+ -e '/DS/s/(DS + 1)/(21)/' \Option-d
+ -e '/FL1/s/(FL1 + 1)/(22)/' \Option-d
+ -e '/FL2/s/(FL2 + 1)/(23)/' \Option-d
+ -e '/FLM/s/(FLM + 1)/(24)/' \Option-d
+ -e '/FRA/s/(FRA + 1)/(25)/' \Option-d
+ -e '/FRB/s/(FRB + 1)/(26)/' \Option-d
+ -e '/FRC/s/(FRC + 1)/(27)/' \Option-d
+ -e '/FRS/s/(FRS + 1)/(28)/' \Option-d
+ -e '/FXM/s/(FXM + 1)/(29)/' \Option-d
+ -e '/L/s/(L + 1)/(30)/' \Option-d
+ -e '/LEV/s/(LEV + 1)/(31)/' \Option-d
+ -e '/LI/s/(LI + 1)/(32)/' \Option-d
+ -e '/LIA/s/(LIA + 1)/(33)/' \Option-d
+ -e '/MB/s/(MB + 1)/(34)/' \Option-d
+ -e '/ME/s/(ME + 1)/(35)/' \Option-d
+ -e '/MBE/s/(MBE + 2)/(37)/' \Option-d
+ -e '/MB6/s/(MB6 + 1)/(38)/' \Option-d
+ -e '/NB/s/(NB + 1)/(39)/' \Option-d
+ -e '/NSI/s/(NSI + 1)/(40)/' \Option-d
+ -e '/RA/s/(RA + 1)/(41)/' \Option-d
+ -e '/RAL/s/(RAL + 1)/(42)/' \Option-d
+ -e '/RAM/s/(RAM + 1)/(43)/' \Option-d
+ -e '/RAS/s/(RAS + 1)/(44)/' \Option-d
+ -e '/RB/s/(RB + 1)/(45)/' \Option-d
+ -e '/RBS/s/(RBS + 1)/(46)/' \Option-d
+ -e '/RS/s/(RS + 1)/(47)/' \Option-d
+ -e '/SH/s/(SH + 1)/(48)/' \Option-d
+ -e '/SH6/s/(SH6 + 1)/(49)/' \Option-d
+ -e '/SI/s/(SI + 1)/(50)/' \Option-d
+ "{srcdir}"ppc-opc.c >"{o}"hacked_ppc-opc.c
diff --git a/opcodes/mpw-make.in b/opcodes/mpw-make.in
deleted file mode 100644
index c01c87e..0000000
--- a/opcodes/mpw-make.in
+++ /dev/null
@@ -1,172 +0,0 @@
-# Makefile template for Configure for the opcodes library.
-# Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc.
-# Written by Cygnus Support.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-s = "{srcdir}"
-o = :
-
-CC = C -d MPW_C
-
-"{o}" \Option-f : "{s}"
-
-# Default rule that puts each file into separate segment.
-
-.c.o \Option-f .c
- {CC} {DepDir}{Default}.c {ALL_CFLAGS} {SymOptions} -s {Default} -o {TargDir}{Default}.c.o
-
-HDEFINES =
-TDEFINES =
-CSWITCHES =
-SymOptions =
-
-prefix = :usr:local
-
-exec_prefix = {prefix}
-bindir = {exec_prefix}:bin
-libdir = {exec_prefix}:lib
-
-datadir = {prefix}:lib
-mandir = {prefix}:man
-man1dir = {mandir}:man1
-man2dir = {mandir}:man2
-man3dir = {mandir}:man3
-man4dir = {mandir}:man4
-man5dir = {mandir}:man5
-man6dir = {mandir}:man6
-man7dir = {mandir}:man7
-man8dir = {mandir}:man8
-man9dir = {mandir}:man9
-infodir = {prefix}:info
-includedir = {prefix}:include
-oldincludedir =
-docdir = {srcdir}:doc
-
-SHELL = :bin:sh
-
-INSTALL = install -c
-INSTALL_PROGRAM = {INSTALL}
-INSTALL_DATA = {INSTALL}
-
-AR = ar
-AR_FLAGS = qc
-CFLAGS = -g
-BISON = bison
-MAKEINFO = makeinfo
-RANLIB = ranlib
-
-INCDIR = "{topsrcdir}"include
-BFDDIR = "{topsrcdir}"bfd
-CSEARCH = -i {INCDIR},{INCDIR}:,{BFDDIR}:,::bfd:,"{INCDIR}":mpw:,::extra-include:
-DEP = mkdep
-
-ALL_CFLAGS = {CSEARCH} {ARCHDEFS}
-
-TARGETLIB = libopcodes.o
-
-# To circumvent a Sun make VPATH bug, each file listed here
-# should also have a foo.o: foo.c line further along in this file.
-
-ALL_MACHINES = a29k-dis.o alpha-dis.o h8300-dis.o h8500-dis.o ¶
- hppa-dis.o i386-dis.o i960-dis.o m68881-ext.o m68k-dis.o ¶
- m88k-dis.o mips-dis.o mips-opc.o sh-dis.o sparc-dis.o ¶
- sparc-opc.o z8k-dis.o
-
-# BFD_MACHINES is set by configure.in.
-
-OFILES = {BFD_MACHINES} "{o}"dis-buf.c.o "{o}"disassemble.c.o
-
-#### host and target dependent Makefile fragments come in here.
-###
-
-FLAGS_TO_PASS = \Option-d
- "against={against}" \Option-d
- "AR={AR}" \Option-d
- "AR_FLAGS={AR_FLAGS}" \Option-d
- "CC={CC}" \Option-d
- "CFLAGS={CFLAGS}" \Option-d
- "RANLIB={RANLIB}" \Option-d
- "MAKEINFO={MAKEINFO}" \Option-d
- "INSTALL={INSTALL}" \Option-d
- "INSTALL_DATA={INSTALL_DATA}" \Option-d
- "INSTALL_PROGRAM={INSTALL_PROGRAM}" \Option-d
- "BISON={BISON}"
-
-
-# C source files that correspond to .o's.
-CFILES = i386-dis.c z8k-dis.c m68k-dis.c mips-dis.c
-
-STAGESTUFF = {TARGETLIB} {OFILES}
-
-all \Option-f {TARGETLIB}
-
-# HDEPFILES comes from the host config; TDEPFILES from the target config.
-
-
-{TARGETLIB} \Option-f {OFILES}
-# rm -f {TARGETLIB}
- Lib -o {TARGETLIB} {OFILES}
-# {RANLIB} {TARGETLIB}
-
-"{o}"disassemble.c.o \Option-f "{s}"disassemble.c {INCDIR}:dis-asm.h
-
-"{o}"a29k-dis.o \Option-f "{s}"a29k-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:a29k.h
-"{o}"dis-buf.c.o \Option-f "{s}"dis-buf.c {INCDIR}:dis-asm.h
-"{o}"h8500-dis.o \Option-f "{s}"h8500-dis.c h8500-opc.h {INCDIR}:dis-asm.h
-"{o}"h8300-dis.o \Option-f "{s}"h8300-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:h8300.h
-"{o}"i386-dis.o \Option-f "{s}"i386-dis.c {INCDIR}:dis-asm.h
-"{o}"i960-dis.o \Option-f "{s}"i960-dis.c {INCDIR}:dis-asm.h
-"{o}"m68881-ext.o \Option-f "{s}"m68881-ext.c {INCDIR}:ieee-float.h
-"{o}"m68k-dis.o \Option-f "{s}"m68k-dis.c {INCDIR}:dis-asm.h {INCDIR}:ieee-float.h \Option-d
- {INCDIR}:opcode:m68k.h
-"{o}"mips-dis.c.o \Option-f "{s}"mips-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:mips.h
-"{o}"mips-opc.c.o \Option-f "{s}"mips-opc.c {INCDIR}:opcode:mips.h
-"{o}"sparc-dis.o \Option-f "{s}"sparc-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:sparc.h
-"{o}"sparc-opc.o \Option-f "{s}"sparc-opc.c {INCDIR}:opcode:sparc.h
-"{o}"z8k-dis.o \Option-f "{s}"z8k-dis.c z8k-opc.h {INCDIR}:dis-asm.h
-"{o}"sh-dis.o \Option-f "{s}"sh-dis.c sh-opc.h {INCDIR}:dis-asm.h
-"{o}"alpha-dis.o \Option-f "{s}"alpha-dis.c alpha-opc.h {INCDIR}:dis-asm.h
-"{o}"hppa-dis.o \Option-f "{s}"hppa-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:hppa.h
-"{o}"m88k-dis.o \Option-f "{s}"m88k-dis.c {INCDIR}:dis-asm.h {INCDIR}:opcode:m88k.h
-
-# Mark everything as depending on config.status, since the timestamp on
-# sysdep.h might actually move backwards if we reconfig and relink it
-# to a different hosts:h-xxx.h file. This will force a recompile anyway.
-RECONFIG = config.status
-
-# Dummy target to force execution of dependent targets.
-#
-#force:
-
-#install \Option-f
-# {INSTALL_DATA} {TARGETLIB} {libdir}:libopcodes.a
-# {RANLIB} {libdir}:libopcodes.a
-
-#Makefile \Option-f {srcdir}:Makefile.in {host_makefile_frag} {target_makefile_frag}
-# {SHELL} .:config.status
-
-dep \Option-f {CFILES}
- mkdep {CFLAGS}
-
-
-# What appears below is generated by a hacked mkdep using gcc -MM.
-
-# DO NOT DELETE THIS LINE -- mkdep uses it.
-# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
-
-
-# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
-
diff --git a/opcodes/mpw-make.sed b/opcodes/mpw-make.sed
new file mode 100644
index 0000000..7096e22
--- /dev/null
+++ b/opcodes/mpw-make.sed
@@ -0,0 +1,14 @@
+# Sed commands to finish translating the opcodes Makefile.in into MPW syntax.
+
+# Empty HDEFINES.
+/HDEFINES/s/@HDEFINES@//
+
+/INCDIR=/s/"{srcdir}":/"{topsrcdir}"/
+/^CSEARCH = .*$/s/$/ -i "{INCDIR}":mpw: -i ::extra-include:/
+/BFD_MACHINES/s/@BFD_MACHINES@/{BFD_MACHINES}/
+/archdefs/s/@archdefs@/{ARCHDEFS}/
+
+# Use a ppc-opc.c that has been tweaked to have less macro nesting.
+# (really only needed for Metrowerks)
+/ppc-opc.c/s/"{s}"ppc-opc\.c/"{o}"hacked_ppc-opc.c/
+/ppc-opc.c.o/s/"{o}"ppc-opc\.c\.o/"{o}"hacked_ppc-opc.c.o/