summaryrefslogtreecommitdiffstats
path: root/sys/boot/pc98
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2004-02-09 16:01:45 +0000
committernyan <nyan@FreeBSD.org>2004-02-09 16:01:45 +0000
commit95fdeae578a3e59b1b367c2a6110fb2b37e8bcc0 (patch)
treebfa91e9031f74bd45478a1f392344af812dfd705 /sys/boot/pc98
parent801e658cdd4ee7e5d845318ee79c08f07be63ef5 (diff)
downloadFreeBSD-src-95fdeae578a3e59b1b367c2a6110fb2b37e8bcc0.zip
FreeBSD-src-95fdeae578a3e59b1b367c2a6110fb2b37e8bcc0.tar.gz
MFi386: Factor out -nostdlib and use PROG.
Diffstat (limited to 'sys/boot/pc98')
-rw-r--r--sys/boot/pc98/Makefile.inc1
-rw-r--r--sys/boot/pc98/boot0.5/Makefile14
-rw-r--r--sys/boot/pc98/boot0/Makefile11
-rw-r--r--sys/boot/pc98/boot2/Makefile2
-rw-r--r--sys/boot/pc98/btx/btx/Makefile13
-rw-r--r--sys/boot/pc98/btx/btxldr/Makefile13
-rw-r--r--sys/boot/pc98/btx/lib/Makefile12
-rw-r--r--sys/boot/pc98/kgzldr/Makefile21
-rw-r--r--sys/boot/pc98/loader/Makefile22
9 files changed, 55 insertions, 54 deletions
diff --git a/sys/boot/pc98/Makefile.inc b/sys/boot/pc98/Makefile.inc
index 86f1400..0c17dd0 100644
--- a/sys/boot/pc98/Makefile.inc
+++ b/sys/boot/pc98/Makefile.inc
@@ -6,6 +6,7 @@ BINDIR?= /boot
LOADER_ADDRESS?=0x100000
CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2
+LDFLAGS+= -nostdlib
# BTX components
.if exists(${.OBJDIR}/../btx)
diff --git a/sys/boot/pc98/boot0.5/Makefile b/sys/boot/pc98/boot0.5/Makefile
index 9763d91..c9028ee 100644
--- a/sys/boot/pc98/boot0.5/Makefile
+++ b/sys/boot/pc98/boot0.5/Makefile
@@ -1,17 +1,20 @@
# $FreeBSD$
+PROG= ${BOOT}.out
+INTERNALPROG=
FILES= ${BOOT}
-CLEANFILES= ${BOOT} ${BOOT}.bin ${BOOT}.out ${OBJS}
+NOMAN=
+SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s
+CLEANFILES= ${BOOT} ${BOOT}.bin
BOOT= boot0.5
-SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s
-OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-
# The base address that we the boot0 code to to run it. Don't change this
# unless you are glutton for punishment.
BOOT_BOOT0_ORG?= 0x0000
+LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG}
+
# The size of boot0.5 must be 7168 bytes
${BOOT}: ${BOOT}.bin
cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168
@@ -19,7 +22,4 @@ ${BOOT}: ${BOOT}.bin
${BOOT}.bin: ${BOOT}.out
objcopy -S -O binary ${BOOT}.out ${.TARGET}
-${BOOT}.out: ${OBJS}
- ${LD} -N -e start -Ttext ${BOOT_BOOT0_ORG} -o ${.TARGET} ${.ALLSRC}
-
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/boot0/Makefile b/sys/boot/pc98/boot0/Makefile
index eeb949a..a4decfe 100644
--- a/sys/boot/pc98/boot0/Makefile
+++ b/sys/boot/pc98/boot0/Makefile
@@ -1,7 +1,11 @@
# $FreeBSD$
+PROG= ${BOOT}.out
+INTERNALPROG=
FILES= ${BOOT}
-CLEANFILES= ${BOOT} ${BOOT}.out ${BOOT}.o
+NOMAN=
+SRCS= ${BOOT}.s
+CLEANFILES= ${BOOT}
BOOT= boot0
@@ -9,10 +13,9 @@ BOOT= boot0
# unless you are glutton for punishment.
BOOT_BOOT0_ORG?= 0x0000
+LDFLAGS=-N -e start -Ttext ${BOOT_BOOT0_ORG}
+
${BOOT}: ${BOOT}.out
objcopy -S -O binary ${BOOT}.out ${.TARGET}
-${BOOT}.out: ${BOOT}.o
- ${LD} -N -e start -Ttext ${BOOT_BOOT0_ORG} -o ${.TARGET} ${BOOT}.o
-
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/boot2/Makefile b/sys/boot/pc98/boot2/Makefile
index 85f6151..955cb53 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -47,7 +47,7 @@ CFLAGS+= -DCOMSPEED=${BOOT_COMCONSOLE_SPEED}
# BOOT_HD_BIAS=1 makes da(0,a) correspond to 1:da(0,a) instead of 0:da(0,a).
CLEANFILES+= boot.nohdr boot.strip boot.ldr boot1 boot2 sizetest
-LDFLAGS+= -N -Ttext 0 -nostdlib -e start
+LDFLAGS+= -N -Ttext 0 -e start
NOSHARED= YES
NOMAN=
STRIP=
diff --git a/sys/boot/pc98/btx/btx/Makefile b/sys/boot/pc98/btx/btx/Makefile
index 3b8408d..eb5d234 100644
--- a/sys/boot/pc98/btx/btx/Makefile
+++ b/sys/boot/pc98/btx/btx/Makefile
@@ -1,5 +1,11 @@
# $FreeBSD$
+PROG= btx.out
+INTERNALPROG=
+NOMAN=
+SRCS= btx.s
+CLEANFILES= btx
+
M4?= m4
.if defined(PAGING)
@@ -28,14 +34,13 @@ ORG= 0x9000
all: btx
-btx: btx.o
- ${LD} -N -e start -Ttext ${ORG} -o btx.out btx.o
+LDFLAGS=-N -e start -Ttext ${ORG}
+
+btx: btx.out
objcopy -S -O binary btx.out ${.TARGET}
btx.o: btx.s
(cd ${.CURDIR}; ${M4} ${M4FLAGS} btx.s) | \
${AS} ${AFLAGS} -o ${.TARGET}
-CLEANFILES+= btx btx.out btx.o
-
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/btx/btxldr/Makefile b/sys/boot/pc98/btx/btxldr/Makefile
index f19e6a4..1c8ed64 100644
--- a/sys/boot/pc98/btx/btxldr/Makefile
+++ b/sys/boot/pc98/btx/btxldr/Makefile
@@ -1,5 +1,11 @@
# $FreeBSD$
+PROG= btxldr.out
+INTERNALPROG=
+NOMAN=
+SRCS= btxldr.s
+CLEANFILES= btxldr
+
M4?= m4
M4FLAGS+= -DLOADER_ADDRESS=${LOADER_ADDRESS} -DPC98
@@ -9,14 +15,13 @@ M4FLAGS+= -DBTXLDR_VERBOSE
all: btxldr
-btxldr: btxldr.o
- ${LD} -N -e start -Ttext ${LOADER_ADDRESS} -o btxldr.out btxldr.o
+LDFLAGS=-N -e start -Ttext ${LOADER_ADDRESS}
+
+btxldr: btxldr.out
objcopy -S -O binary btxldr.out ${.TARGET}
btxldr.o: btxldr.s
(cd ${.CURDIR}; ${M4} ${M4FLAGS} btxldr.s ) | \
${AS} ${AFLAGS} -o ${.TARGET}
-CLEANFILES+= btxldr btxldr.out btxldr.o
-
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/btx/lib/Makefile b/sys/boot/pc98/btx/lib/Makefile
index fb56ca1..563f001 100644
--- a/sys/boot/pc98/btx/lib/Makefile
+++ b/sys/boot/pc98/btx/lib/Makefile
@@ -1,11 +1,9 @@
# $FreeBSD$
-OBJS= btxcsu.o btxsys.o btxv86.o
-CLEANFILES= crt0.o
-
-all: crt0.o
-
-crt0.o: ${OBJS}
- ${LD} ${LDFLAGS} -i -o ${.TARGET} ${OBJS}
+PROG= crt0.o
+INTERNALPROG=
+NOMAN=
+SRCS= btxcsu.s btxsys.s btxv86.s
+LDFLAGS=-Wl,-r
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/kgzldr/Makefile b/sys/boot/pc98/kgzldr/Makefile
index a3ddf0f..f41fe4b 100644
--- a/sys/boot/pc98/kgzldr/Makefile
+++ b/sys/boot/pc98/kgzldr/Makefile
@@ -1,26 +1,21 @@
# $FreeBSD$
-FILES= kgzldr.o
-FILESOWN= ${LIBOWN}
-FILESGRP= ${LIBGRP}
-FILESMODE= ${LIBMODE}
-FILESDIR= ${LIBDIR}
-CLEANFILES= kgzldr.o
+PROG= kgzldr.o
+BINMODE=${LIBMODE}
+BINDIR= ${LIBDIR}
+NOMAN=
SRCS= start.s boot.c inflate.c lib.c crt.s sio.s
-OBJS= ${SRCS:N*.h:R:S/$/.o/g}
CFLAGS= -Os
CFLAGS+=-DKZIP
-LDFLAGS=-nostdlib -static -Wl,-r
+NOSHARED=
+LDFLAGS=-Wl,-r
.PATH: ${.CURDIR}/../../../kern
-
.PATH: ${.CURDIR}/../../i386/kgzldr
-AFLAGS+=--defsym PC98=1
BOOT_COMCONSOLE_PORT?= 0x238
-AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
-kgzldr.o: ${OBJS}
- ${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS}
+AFLAGS+=--defsym PC98=1
+AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
index 7824fdd..8a4ab53 100644
--- a/sys/boot/pc98/loader/Makefile
+++ b/sys/boot/pc98/loader/Makefile
@@ -1,11 +1,12 @@
# $FreeBSD$
+PROG= loader.sym
+INTERNALPROG=
NEWVERSWHAT= "bootstrap loader" pc98
-CFLAGS+= -DPC98
-
# architecture-specific loader code
SRCS= main.c conf.c vers.c
+CFLAGS+= -DPC98
.PATH: ${.CURDIR}/../../i386/loader
# Enable PXE TFTP or NFS support, not both.
@@ -23,11 +24,7 @@ HAVE_ISABUS= yes
# Enable BootForth
BOOT_FORTH= yes
CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386
-.if exists(${.OBJDIR}/../../ficl/libficl.a)
LIBFICL= ${.OBJDIR}/../../ficl/libficl.a
-.else
-LIBFICL= ${.CURDIR}/../../ficl/libficl.a
-.endif
.endif
.if defined(LOADER_BZIP2_SUPPORT)
@@ -44,10 +41,10 @@ CFLAGS+= -I${.CURDIR}/../../common
CFLAGS+= -I${.CURDIR}/../../i386
CFLAGS+= -I.
-CLEANFILES= vers.c loader loader.list loader.bin loader.sym loader.help
+CLEANFILES= vers.c loader loader.list loader.bin loader.help
CFLAGS+= -Wall
-LDFLAGS= -nostdlib -static -Ttext 0x0
+LDFLAGS= -static -Ttext 0x0
# pc98 standalone support library
LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
@@ -66,7 +63,7 @@ CFLAGS+= -I${.CURDIR}/../btx/lib
vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
-loader: loader.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
+loader: loader.bin ${BTXLDR} ${BTXKERN}
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
-b ${BTXKERN} loader.bin
# /usr/bin/kzip ${.TARGET}
@@ -90,10 +87,7 @@ FILESDIR_loader.conf= /boot/defaults
FILES+= ${.CURDIR}/../../i386/loader/loader.rc
.endif
-OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-
-loader.sym: ${OBJS} ${LIBFICL} ${LIBPC98} ${LIBSTAND}
- ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} \
- ${LIBFICL} ${LIBPC98} ${LIBSTAND}
+DPADD= ${BTXCRT} ${LIBFICL} ${LIBPC98} ${LIBSTAND}
+LDADD= ${BTXCRT} ${LIBFICL} ${LIBPC98} -lstand
.include <bsd.prog.mk>
OpenPOWER on IntegriCloud