summaryrefslogtreecommitdiffstats
path: root/sys/boot/ficl/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/ficl/Makefile')
-rw-r--r--sys/boot/ficl/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/boot/ficl/Makefile b/sys/boot/ficl/Makefile
index 6302da6..d3b8924 100644
--- a/sys/boot/ficl/Makefile
+++ b/sys/boot/ficl/Makefile
@@ -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
OpenPOWER on IntegriCloud