Make it easier to change the native emulation.

Tested on:	alpha, i386, sparc64
This commit is contained in:
David E. O'Brien 2002-03-29 00:41:01 +00:00
parent 4f453a6c89
commit eb294035cb
6 changed files with 62 additions and 57 deletions

View File

@ -40,8 +40,8 @@ CFLAGS+= -I${BINUTILSDISTDIR}/ld
EMXFR=
EMLST=
.for _e in ${EMS}
EMXFR+= extern ld_emulation_xfer_type ${_e};
EMLST+= &${_e},
EMXFR+= extern ld_emulation_xfer_type ld_${_e}_emulation;
EMLST+= &ld_${_e}_emulation,
.endfor
ldemul-list.h:

View File

@ -3,28 +3,29 @@
TARGET_TUPLE?= alpha-unknown-freebsd
.if ${TARGET_ARCH} == "alpha"
NATIVE_EMULATION= elf64alpha
HOST= ${TARGET_TUPLE}
CFLAGS+= -DDEFAULT_EMULATION=\"elf64alpha\"
CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
_alpha_path= \"${TOOLS_PREFIX}/usr/lib\"
.else
_alpha_path= \"/usr/cross/alpha-freebsd/usr/lib\"
.endif
EMS+= ld_elf64alpha_emulation
LDSCRIPTS+= elf64alpha.x elf64alpha.xbn elf64alpha.xn elf64alpha.xr \
elf64alpha.xs elf64alpha.xu alpha.x alpha.xbn \
alpha.xn alpha.xr alpha.xu elf64alpha.xc elf64alpha.xsc
SRCS+= eelf64alpha.c ealpha.c
CLEANFILES+= eelf64alpha.c ealpha.c
EMS+= ${NATIVE_EMULATION}
LDSCRIPTS+= ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu alpha.x alpha.xbn \
alpha.xn alpha.xr alpha.xu ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
SRCS+= e${NATIVE_EMULATION}.c ealpha.c
CLEANFILES+= e${NATIVE_EMULATION}.c ealpha.c
eelf64alpha.c: emulparams/elf64alpha.sh emultempl/elf32.em \
e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
scripttempl/elf.sc genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_alpha_path} \
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
elf64alpha "" elf64alpha ${TARGET_TUPLE}
${NATIVE_EMULATION} "" ${NATIVE_EMULATION} ${TARGET_TUPLE}
ealpha.c: emulparams/elf64alpha.sh emultempl/elf32.em scripttempl/elf.sc \
ealpha.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em scripttempl/elf.sc \
genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_alpha_path} \
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
elf64alpha "" alpha ${TARGET_TUPLE}
${NATIVE_EMULATION} "" alpha ${TARGET_TUPLE}

View File

@ -3,27 +3,28 @@
TARGET_TUPLE?= i386-unknown-freebsd
.if ${TARGET_ARCH} == "i386"
NATIVE_EMULATION= elf_i386
HOST= ${TARGET_TUPLE}
CFLAGS+= -DDEFAULT_EMULATION=\"elf_i386\"
CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
_i386_path= \"${TOOLS_PREFIX}/usr/lib\"
.else
_i386_path= \"/usr/cross/i386-freebsd/usr/lib\"
.endif
EMS+= ld_elf_i386_emulation
LDSCRIPTS+= elf_i386.x elf_i386.xbn elf_i386.xn elf_i386.xr \
elf_i386.xs elf_i386.xu elf_i386.xc elf_i386.xsc
SRCS+= eelf_i386.c
CLEANFILES+= eelf_i386.c
EMS+= ${NATIVE_EMULATION}
LDSCRIPTS+= ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
SRCS+= e${NATIVE_EMULATION}.c
CLEANFILES+= e${NATIVE_EMULATION}.c
eelf_i386.c: emulparams/elf_i386.sh emultempl/elf32.em scripttempl/elf.sc \
e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em scripttempl/elf.sc \
genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_i386_path} \
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
elf_i386 "" elf_i386 ${TARGET_TUPLE}
"${NATIVE_EMULATION}" "" ${NATIVE_EMULATION} "${TARGET_TUPLE}"
.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
EMS+= ld_i386pe_emulation
EMS+= i386pe
LDSCRIPTS+= i386pe.x \
i386pe.xbn \
i386pe.xn \

View File

@ -3,22 +3,23 @@
TARGET_TUPLE?= ia64-unknown-freebsd
.if ${TARGET_ARCH} == "ia64"
NATIVE_EMULATION= elf64_ia64
HOST= ${TARGET_TUPLE} # do what?? how does this work for a cross-build??
CFLAGS+= -DDEFAULT_EMULATION=\"elf64_ia64\"
CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
_ia64_path= \"${TOOLS_PREFIX}/usr/lib\"
.else
_ia64_path= \"/usr/cross/ia64-freebsd/usr/lib\"
.endif
EMS+= ld_elf64_ia64_emulation
LDSCRIPTS+= elf64_ia64.x elf64_ia64.xbn elf64_ia64.xn elf64_ia64.xr \
elf64_ia64.xs elf64_ia64.xu elf64_ia64.xc elf64_ia64.xsc
SRCS+= eelf64_ia64.c
CLEANFILES+= eelf64_ia64.c
EMS+= ${NATIVE_EMULATION}
LDSCRIPTS+= ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
SRCS+= e${NATIVE_EMULATION}.c
CLEANFILES+= e${NATIVE_EMULATION}.c
eelf64_ia64.c: emulparams/elf64_ia64.sh emultempl/elf32.em scripttempl/elf.sc \
e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em scripttempl/elf.sc \
genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_ia64_path} \
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
"elf64_ia64" "" elf64_ia64 "${TARGET_TUPLE}"
"${NATIVE_EMULATION}" "" ${NATIVE_EMULATION} "${TARGET_TUPLE}"

View File

@ -3,6 +3,7 @@
TARGET_TUPLE?= powerpc-unknown-freebsd
.if ${TARGET_ARCH} == "powerpc"
NATIVE_EMULATION= elf32ppc
HOST= ${TARGET_TUPLE}
CFLAGS+= -DDEFAULT_EMULATION=\"elf_powerpc\"
CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
@ -10,20 +11,20 @@ _powerpc_path= \"${TOOLS_PREFIX}/usr/lib\"
.else
_powerpc_path= \"/usr/cross/powerpc-freebsd/usr/lib\"
.endif
EMS+= ld_elf32ppc_emulation \
ld_ppcmacos_emulation \
ld_ppcnw_emulation \
ld_ppcpe_emulation \
ld_aixrs6_emulation \
ld_rs6000lynx_emulation
LDSCRIPTS+= elf32ppc.x \
elf32ppc.xbn \
elf32ppc.xn \
elf32ppc.xr \
elf32ppc.xs \
elf32ppc.xu \
elf32ppc.xc \
elf32ppc.xsc \
EMS+= ${NATIVE_EMULATION} \
ppcmacos \
ppcnw \
ppcpe \
aixrs6 \
rs6000lynx
LDSCRIPTS+= ${NATIVE_EMULATION}.x \
${NATIVE_EMULATION}.xbn \
${NATIVE_EMULATION}.xn \
${NATIVE_EMULATION}.xr \
${NATIVE_EMULATION}.xs \
${NATIVE_EMULATION}.xu \
${NATIVE_EMULATION}.xc \
${NATIVE_EMULATION}.xsc \
ppcmacos.x \
ppcmacos.xbn \
ppcmacos.xn \
@ -59,24 +60,24 @@ LDSCRIPTS+= elf32ppc.x \
rs6000lynx.xu \
rs6000lynx.xc \
rs6000lynx.xsc
SRCS+= eelf32ppc.c \
SRCS+= e${NATIVE_EMULATION}.c \
eppcmacos.c \
eppcnw.c \
eppcpe.c \
eaixrs6.c \
ers6000lynx.c
CLEANFILES+= eelf32ppc.c \
CLEANFILES+= e${NATIVE_EMULATION}.c \
eppcmacos.c \
eppcnw.c \
eppcpe.c \
eaixrs6.c \
ers6000lynx.c
eelf32ppc.c: emulparams/elf32ppc.sh emultempl/elf32.em scripttempl/elfppc.sc \
e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em scripttempl/elfppc.sc \
genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${BINUTILSDISTDIR}/ld \
${_powerpc_path} ${HOST} ${TARGET_TUPLE} \
${TARGET_TUPLE} elf32ppc "" elf32ppc
${TARGET_TUPLE} ${NATIVE_EMULATION} "" ${NATIVE_EMULATION}
eppcmacos.c: emulparams/ppcmacos.sh emultempl/aix.em scripttempl/aix.sc \
genscripts.sh stringify.sed

View File

@ -3,31 +3,32 @@
TARGET_TUPLE?= sparc64-unknown-freebsd
.if ${TARGET_ARCH} == "sparc64"
NATIVE_EMULATION= elf64_sparc
HOST= ${TARGET_TUPLE}
CFLAGS+= -DDEFAULT_EMULATION=\"elf64_sparc\"
CFLAGS+= -DDEFAULT_EMULATION=\"${NATIVE_EMULATION}\"
CFLAGS+= -DTARGET=\"${TARGET_TUPLE}\"
_sparc_path= \"${TOOLS_PREFIX}/usr/lib\"
.else
_sparc_path= \"/usr/cross/sparc-freebsd/usr/lib\"
.endif
EMS+= ld_elf64_sparc_emulation
LDSCRIPTS+= elf64_sparc.x elf64_sparc.xbn elf64_sparc.xn elf64_sparc.xr \
elf64_sparc.xs elf64_sparc.xu elf64_sparc.xc elf64_sparc.xsc
SRCS+= eelf64_sparc.c
CLEANFILES+= eelf64_sparc.c
EMS+= ${NATIVE_EMULATION}
LDSCRIPTS+= ${NATIVE_EMULATION}.x ${NATIVE_EMULATION}.xbn ${NATIVE_EMULATION}.xn ${NATIVE_EMULATION}.xr \
${NATIVE_EMULATION}.xs ${NATIVE_EMULATION}.xu ${NATIVE_EMULATION}.xc ${NATIVE_EMULATION}.xsc
SRCS+= e${NATIVE_EMULATION}.c
CLEANFILES+= e${NATIVE_EMULATION}.c
EMS+= ld_elf32_sparc_emulation
EMS+= elf32_sparc
LDSCRIPTS+= elf32_sparc.x elf32_sparc.xbn elf32_sparc.xn elf32_sparc.xr \
elf32_sparc.xs elf32_sparc.xu elf32_sparc.xc elf32_sparc.xsc
SRCS+= eelf32_sparc.c
CLEANFILES+= eelf32_sparc.c
eelf64_sparc.c: emulparams/elf64_sparc.sh emultempl/elf32.em \
e${NATIVE_EMULATION}.c: emulparams/${NATIVE_EMULATION}.sh emultempl/elf32.em \
scripttempl/elf.sc genscripts.sh stringify.sed
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_sparc_path} \
${HOST} ${TARGET_TUPLE} ${TARGET_TUPLE} \
elf64_sparc "" elf64_sparc ${TARGET_TUPLE}
${NATIVE_EMULATION} "" ${NATIVE_EMULATION} ${TARGET_TUPLE}
eelf32_sparc.c: emulparams/elf32_sparc.sh emultempl/elf32.em \
scripttempl/elf.sc genscripts.sh stringify.sed