Untangle building of AMD64 boot code.

Tested on:	amd64 (sledge)
This commit is contained in:
Ruslan Ermilov 2004-02-07 08:10:07 +00:00
parent a54c3906ad
commit 7e39a38ec9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=125556
7 changed files with 13 additions and 28 deletions

View File

@ -1,9 +1,5 @@
# $FreeBSD$
.if ${MACHINE_ARCH} == "amd64"
.MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
.endif
.if !defined(NOFORTH)
# Build the add-in FORTH interpreter.
SUBDIR+= ficl
@ -15,7 +11,7 @@ SUBDIR+= ofw
.endif
# Pick the machine-dependent subdir based on the target architecture.
SUBDIR+= ${MACHINE}
SUBDIR+= ${MACHINE:S/amd64/i386/}
# Build ARC / AlphaBIOS executable on the Alpha
# (this is a WIP (work in progress)).

View File

@ -1,10 +1,6 @@
# $FreeBSD$
#
.if ${MACHINE_ARCH} == "amd64"
.MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
.endif
.PATH: ${.CURDIR}/${MACHINE_ARCH}
.PATH: ${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/}
BASE_SRCS= dict.c ficl.c fileaccess.c float.c loader.c math64.c \
prefix.c search.c stack.c tools.c vm.c words.c
@ -14,7 +10,7 @@ CFLAGS+= -ffreestanding
.if ${MACHINE_ARCH} == "alpha"
CFLAGS+= -mno-fp-regs
.endif
.if ${MACHINE_ARCH} == "i386"
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
CFLAGS+= -mpreferred-stack-boundary=2
.endif
.if ${MACHINE_ARCH} == "powerpc"
@ -44,17 +40,18 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
# Optional OO extension softwords
#SOFTWORDS+= oo.fr classes.fr
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -m32 -I.
.endif
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -I${.CURDIR}/../common
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH:S/amd64/i386/} \
-I${.CURDIR}/../common
softcore.c: ${SOFTWORDS} softcore.awk
(cd ${.CURDIR}/softwords; cat ${SOFTWORDS} \
| awk -f softcore.awk -v datestamp="`LC_ALL=C date`") > ${.TARGET}
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
${SRCS:M*.c:R:S/$/.o/g}: machine
beforedepend ${OBJS}: machine

View File

@ -8,10 +8,6 @@ LOADER_ADDRESS?=0x200000
CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2
.if ${MACHINE_ARCH} == "amd64"
.MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
.endif
.if defined(REALLY_AMD64)
CFLAGS+= -m32
LDFLAGS+= -m elf_i386_fbsd
AFLAGS+= --32

View File

@ -93,13 +93,11 @@ boot2.h: boot1.out
ORG1=`printf "%d" ${ORG1}` \
REL1=`printf "%d" ${REL1}` > ${.TARGET}
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
boot2.s: machine
CLEANFILES+= machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
CLEANFILES+= machine
.endif
.include <bsd.prog.mk>

View File

@ -93,13 +93,11 @@ boot2.h: boot1.out
ORG1=`printf "%d" ${ORG1}` \
REL1=`printf "%d" ${REL1}` > ${.TARGET}
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
boot2.s: machine
CLEANFILES+= machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
CLEANFILES+= machine
.endif
.include <bsd.prog.mk>

View File

@ -33,7 +33,7 @@ CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
.include <bsd.lib.mk>
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
${OBJS}: machine
CLEANFILES+= machine
machine:

View File

@ -96,7 +96,7 @@ loader.sym: ${OBJS} ${LIBFICL} ${LIBI386} ${LIBSTAND}
${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} \
${LIBFICL} ${LIBI386} ${LIBSTAND}
.if defined(REALLY_AMD64)
.if ${MACHINE_ARCH} == "amd64"
${OBJS}: machine
CLEANFILES+= machine
machine: