ecc4dcbd82
The target machine is represented by TARGET_ARCH. MACHINE_ARCH always represents the host machine. When TARGET_ARCH is not defined, it is assumed to be equal to MACHINE_ARCH. This means that we're building a native toolset by default. We're creating cross-compilation tools when MACHINE_ARCH != TARGET_ARCH. TARGET_ARCH is defined when building binutils as part of the bootstrap build and is set to reflect the architecture we're currently cross- building. With this change binutils is ready for cross-building.
42 lines
1.2 KiB
Makefile
42 lines
1.2 KiB
Makefile
#
|
|
# $FreeBSD$
|
|
#
|
|
|
|
.if ${TARGET_ARCH} == "i386"
|
|
HOST= i386-unknown-freebsdelf
|
|
CFLAGS+= -DDEFAULT_EMULATION=\"elf_i386\"
|
|
CFLAGS+= -DTARGET=\"i386-unknown-freebsdelf\"
|
|
_i386_path= \"/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
|
|
SRCS+= eelf_i386.c
|
|
CLEANFILES+= eelf_i386.c
|
|
|
|
eelf_i386.c: emulparams/elf_i386.sh emultempl/elf32.em \
|
|
scripttempl/elf.sc genscripts.sh emultempl/stringify.sed
|
|
sh ${.CURDIR}/genscripts.sh ${SRCDIR}/ld ${_i386_path} \
|
|
${HOST} i386-unknown-freebsdelf i386-unknown-freebsdelf \
|
|
elf_i386 "" elf_i386 i386-unknown-freebsdelf
|
|
|
|
.if defined(BINUTILSDISTDIR) && exists(${BINUTILSDISTDIR})
|
|
EMS+= ld_i386pe_emulation
|
|
LDSCRIPTS+= i386pe.x \
|
|
i386pe.xbn \
|
|
i386pe.xn \
|
|
i386pe.xr \
|
|
i386pe.xu
|
|
SRCS+= ei386pe.c
|
|
CLEANFILES+= ei386pe.c
|
|
|
|
ei386pe.c: emulparams/i386pe.sh emultempl/pe.em \
|
|
scripttempl/pe.sc genscripts.sh emultempl/stringify.sed
|
|
sh ${.CURDIR}/genscripts.sh ${BINUTILSDISTDIR}/ld \
|
|
/usr/cross/winnt/lib ${HOST} i386-unknown-freebsdwinnt \
|
|
i386-unknown-freebsdwinnt i386pe "" i386pe \
|
|
i386-unknown-freebsdwinnt
|
|
.endif
|