From c12bb13bb30379f6de760a585c705d0bf54bf90b Mon Sep 17 00:00:00 2001
From: ru <ru@FreeBSD.org>
Date: Sat, 7 Feb 2004 08:10:07 +0000
Subject: Untangle building of AMD64 boot code.

Tested on:	amd64 (sledge)
---
 sys/boot/ficl/Makefile | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

(limited to 'sys/boot/ficl')

diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index 69d6ca7..6f913b9 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -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
-- 
cgit v1.1