summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/boot/Makefile6
-rw-r--r--sys/boot/ficl/Makefile15
-rw-r--r--sys/boot/i386/Makefile.inc4
-rw-r--r--sys/boot/i386/boot2/Makefile6
-rw-r--r--sys/boot/i386/gptboot/Makefile6
-rw-r--r--sys/boot/i386/libi386/Makefile2
-rw-r--r--sys/boot/i386/loader/Makefile2
7 files changed, 13 insertions, 28 deletions
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index 8dbf1b1..aa2c19c 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -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)).
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
diff --git a/sys/boot/i386/Makefile.inc b/sys/boot/i386/Makefile.inc
index 5bf548d..6bd4f31 100644
--- a/sys/boot/i386/Makefile.inc
+++ b/sys/boot/i386/Makefile.inc
@@ -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
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 66f1352..364c21f 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -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>
diff --git a/sys/boot/i386/gptboot/Makefile b/sys/boot/i386/gptboot/Makefile
index 66f1352..364c21f 100644
--- a/sys/boot/i386/gptboot/Makefile
+++ b/sys/boot/i386/gptboot/Makefile
@@ -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>
diff --git a/sys/boot/i386/libi386/Makefile b/sys/boot/i386/libi386/Makefile
index 2ff8f0d..253e4e5 100644
--- a/sys/boot/i386/libi386/Makefile
+++ b/sys/boot/i386/libi386/Makefile
@@ -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:
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index 4f930f6..4f5f3f2 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -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:
OpenPOWER on IntegriCloud