Build on amd64. Yes, I know this isn't particularly nice.

This commit is contained in:
Peter Wemm 2003-06-26 03:51:57 +00:00
parent ba1cabf4b9
commit 062b3e0c77
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116864
9 changed files with 59 additions and 8 deletions

View file

@ -1,8 +1,7 @@
# $FreeBSD$
.if ${MACHINE_ARCH} == "amd64"
MACHINE_ARCH=i386
MACHINE=i386
.MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
.endif
.if !defined(NOFORTH)

View file

@ -34,7 +34,3 @@ MAN+= ../forth/loader.4th.8
.endif
MAN+= loader.8
.if ${MACHINE_ARCH} == "amd64"
CFLAGS+= -m32
.endif

View file

@ -1,5 +1,9 @@
# $FreeBSD$
#
.if ${MACHINE_ARCH} == "amd64"
.MAKEFLAGS: MACHINE_ARCH=i386 MACHINE=i386 REALLY_AMD64=true
.endif
.PATH: ${.CURDIR}/${MACHINE_ARCH}
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
@ -37,8 +41,24 @@ SOFTWORDS= softcore.fr jhlocal.fr marker.fr freebsd.fr ficllocal.fr \
# Optional OO extension softwords
#SOFTWORDS+= oo.fr classes.fr
.if defined(REALLY_AMD64)
CFLAGS+= -m32 -I.
LDFLAGS= -m elf_i386_fbsd
.endif
CFLAGS+= -I${.CURDIR} -I${.CURDIR}/${MACHINE_ARCH} -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)
${SRCS:M*.c:R:S/$/.o/g}: machine
beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../i386/include machine
CLEANFILES+= machine
.endif

View file

@ -4,3 +4,14 @@
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) && !defined(__been_to_Makefile_inc)
__been_to_Makefile_inc= 1
CFLAGS+= -m32
LDFLAGS+= -m elf_i386_fbsd
AFLAGS+= --32
.endif

View file

@ -109,3 +109,15 @@ install:
boot2 ${DESTDIR}${BINDIR}/boot2
.include <bsd.prog.mk>
.if defined(REALLY_AMD64)
boot2.o: machine
beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
CLEANFILES+= machine
.endif

View file

@ -0,0 +1,2 @@
# $FreeBSD$
.include <${.CURDIR}/../../Makefile.inc>

View file

@ -19,5 +19,4 @@ btxldr.o: btxldr.s
CLEANFILES+= btxldr btxldr.out btxldr.o
.include <${.CURDIR}/../../Makefile.inc>
.include <bsd.prog.mk>

View file

@ -109,3 +109,15 @@ install:
boot2 ${DESTDIR}${BINDIR}/boot2
.include <bsd.prog.mk>
.if defined(REALLY_AMD64)
boot2.o: machine
beforedepend ${OBJS}: machine
machine:
ln -sf ${.CURDIR}/../../../i386/include machine
CLEANFILES+= machine
.endif

View file

@ -85,7 +85,7 @@ CFLAGS+= -elf
vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
${CC} -c vers.c
${CC} ${CFLAGS} -c vers.c
${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \