summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2004-02-07 12:19:44 +0000
committernyan <nyan@FreeBSD.org>2004-02-07 12:19:44 +0000
commita1e0ad4bf3b12f2aad6b934ea006fef4c1720e02 (patch)
tree484ffc9ed61b2bd87c53a9eb0ba2f7152a75c04a /sys/boot
parentb377ec7a9a2093b8c3c6e8c28b306c8bc7094120 (diff)
downloadFreeBSD-src-a1e0ad4bf3b12f2aad6b934ea006fef4c1720e02.zip
FreeBSD-src-a1e0ad4bf3b12f2aad6b934ea006fef4c1720e02.tar.gz
MFi386: Cleanups to sys/boot makefiles.
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/pc98/Makefile.inc16
-rw-r--r--sys/boot/pc98/boot0.5/Makefile32
-rw-r--r--sys/boot/pc98/boot0/Makefile22
-rw-r--r--sys/boot/pc98/boot2/Makefile1
-rw-r--r--sys/boot/pc98/btx/Makefile.inc3
-rw-r--r--sys/boot/pc98/btx/btxldr/Makefile1
-rw-r--r--sys/boot/pc98/kgzldr/Makefile15
-rw-r--r--sys/boot/pc98/libpc98/Makefile14
-rw-r--r--sys/boot/pc98/loader/Makefile70
9 files changed, 70 insertions, 104 deletions
diff --git a/sys/boot/pc98/Makefile.inc b/sys/boot/pc98/Makefile.inc
index 53653eb..86f1400 100644
--- a/sys/boot/pc98/Makefile.inc
+++ b/sys/boot/pc98/Makefile.inc
@@ -2,5 +2,17 @@
#
# $FreeBSD$
-LOADER_ADDRESS?= 0x100000
-CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2
+BINDIR?= /boot
+
+LOADER_ADDRESS?=0x100000
+CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2
+
+# BTX components
+.if exists(${.OBJDIR}/../btx)
+BTXDIR= ${.OBJDIR}/../btx
+.else
+BTXDIR= ${.CURDIR}/../btx
+.endif
+BTXLDR= ${BTXDIR}/btxldr/btxldr
+BTXKERN= ${BTXDIR}/btx/btx
+BTXCRT= ${BTXDIR}/lib/crt0.o
diff --git a/sys/boot/pc98/boot0.5/Makefile b/sys/boot/pc98/boot0.5/Makefile
index c90c0c0..9763d91 100644
--- a/sys/boot/pc98/boot0.5/Makefile
+++ b/sys/boot/pc98/boot0.5/Makefile
@@ -1,25 +1,25 @@
# $FreeBSD$
-PROG= boot0.5
-OBJS= start.o boot.o boot0.5.o disk.o selector.o support.o \
- syscons.o
-NOMAN=
-STRIP=
-BINDIR?= /boot
-BINMODE= 444
+FILES= ${BOOT}
+CLEANFILES= ${BOOT} ${BOOT}.bin ${BOOT}.out ${OBJS}
-ORG= 0x000
+BOOT= boot0.5
-# The size of boot0.5 must be 7168 bytes
-boot0.5: boot0.5.bin
- cat boot0.5.bin /dev/zero | dd of=boot0.5 bs=1 count=7168
+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
-boot0.5.bin: boot0.5.out
- objcopy -S -O binary boot0.5.out ${.TARGET}
+# The size of boot0.5 must be 7168 bytes
+${BOOT}: ${BOOT}.bin
+ cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168
-boot0.5.out: ${OBJS}
- ${LD} -N -e start -Ttext ${ORG} -o ${.TARGET} ${OBJS}
+${BOOT}.bin: ${BOOT}.out
+ objcopy -S -O binary ${BOOT}.out ${.TARGET}
-CLEANFILES+= boot0.5.out boot0.5.bin
+${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 27a2a3a..eeb949a 100644
--- a/sys/boot/pc98/boot0/Makefile
+++ b/sys/boot/pc98/boot0/Makefile
@@ -1,20 +1,18 @@
# $FreeBSD$
-PROG= boot0
-OBJS= boot0.o
-NOMAN=
-STRIP=
-BINDIR?= /boot
-BINMODE= 444
+FILES= ${BOOT}
+CLEANFILES= ${BOOT} ${BOOT}.out ${BOOT}.o
-ORG= 0x0000
+BOOT= boot0
-boot0: boot0.out
- objcopy -S -O binary boot0.out ${.TARGET}
+# 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
-boot0.out: ${OBJS}
- ${LD} -N -e start -Ttext ${ORG} -o ${.TARGET} ${OBJS}
+${BOOT}: ${BOOT}.out
+ objcopy -S -O binary ${BOOT}.out ${.TARGET}
-CLEANFILES+= boot0.out
+${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 d3ab21c..42a49ff 100644
--- a/sys/boot/pc98/boot2/Makefile
+++ b/sys/boot/pc98/boot2/Makefile
@@ -6,7 +6,6 @@ PROG= boot
SRCS= start.S table.c boot2.S boot.c asm.S bios.S serial.S
SRCS+= probe_keyboard.c io.c disk.c sys.c
-BINDIR= /boot
BINMODE= 444
CFLAGS= -elf -Os -mrtd \
-ffreestanding -fno-builtin -fno-guess-branch-probability \
diff --git a/sys/boot/pc98/btx/Makefile.inc b/sys/boot/pc98/btx/Makefile.inc
new file mode 100644
index 0000000..265f86d
--- /dev/null
+++ b/sys/boot/pc98/btx/Makefile.inc
@@ -0,0 +1,3 @@
+# $FreeBSD$
+
+.include "../Makefile.inc"
diff --git a/sys/boot/pc98/btx/btxldr/Makefile b/sys/boot/pc98/btx/btxldr/Makefile
index f88004b..f19e6a4 100644
--- a/sys/boot/pc98/btx/btxldr/Makefile
+++ b/sys/boot/pc98/btx/btxldr/Makefile
@@ -19,5 +19,4 @@ btxldr.o: btxldr.s
CLEANFILES+= btxldr btxldr.out btxldr.o
-.include <${.CURDIR}/../../Makefile.inc>
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/kgzldr/Makefile b/sys/boot/pc98/kgzldr/Makefile
index 13bd2cd..eb249d2 100644
--- a/sys/boot/pc98/kgzldr/Makefile
+++ b/sys/boot/pc98/kgzldr/Makefile
@@ -1,5 +1,12 @@
# $FreeBSD$
+FILES= kgzldr.o
+FILESOWN= ${LIBOWN}
+FILESGRP= ${LIBGRP}
+FILESMODE= ${LIBMODE}
+FILESDIR= ${LIBDIR}
+CLEANFILES= kgzldr.o
+
SRCS= start.s boot.c inflate.c lib.c crt.s sio.s
OBJS= ${SRCS:N*.h:R:S/$/.o/g}
CFLAGS= -ffreestanding
@@ -11,18 +18,10 @@ LDFLAGS=-nostdlib -static -Wl,-r
.PATH: ${.CURDIR}/../../i386/kgzldr
AFLAGS+=--defsym PC98=1
-CLEANFILES=kgzldr.o
-
BOOT_COMCONSOLE_PORT?= 0x238
AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
-all: kgzldr.o
-
kgzldr.o: ${OBJS}
${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS}
-realinstall:
- ${INSTALL} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \
- kgzldr.o ${DESTDIR}${LIBDIR}
-
.include <bsd.prog.mk>
diff --git a/sys/boot/pc98/libpc98/Makefile b/sys/boot/pc98/libpc98/Makefile
index fb783fd..d9ab9eb 100644
--- a/sys/boot/pc98/libpc98/Makefile
+++ b/sys/boot/pc98/libpc98/Makefile
@@ -32,18 +32,4 @@ CFLAGS+= -I${.CURDIR}/../../common -I${.CURDIR}/../btx/lib \
# the location of libstand
CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
-# Make "machine" required for all objects
-# (based on the more complete case in sys/i386/boot/Makefile.inc)
-${SRCS:M*.c:R:S/$/.o/g}: machine
-
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
-
-CLEANFILES+= machine
-machine:
- ln -sf ${.CURDIR}/../../../i386/include machine
-
-.endif
-
.include <bsd.lib.mk>
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
index be070c5..e9081e1 100644
--- a/sys/boot/pc98/loader/Makefile
+++ b/sys/boot/pc98/loader/Makefile
@@ -1,15 +1,11 @@
# $FreeBSD$
-PROG= loader
-STRIP=
NEWVERSWHAT= "bootstrap loader" pc98
-BINDIR?= /boot
-INSTALLFLAGS= -b
CFLAGS+= -DPC98
# architecture-specific loader code
-SRCS= main.c conf.c
+SRCS= main.c conf.c vers.c
.PATH: ${.CURDIR}/../../i386/loader
CFLAGS+= -ffreestanding
@@ -44,11 +40,12 @@ CFLAGS+= -DLOADER_GZIP_SUPPORT
# Always add MI sources
.PATH: ${.CURDIR}/../../common
-.include <${.CURDIR}/../../common/Makefile.inc>
+.include "${.CURDIR}/../../common/Makefile.inc"
CFLAGS+= -I${.CURDIR}/../../common
-CFLAGS+= -I${.CURDIR}/../../.. -I. -I${.CURDIR}/../../i386
+CFLAGS+= -I${.CURDIR}/../../i386
+CFLAGS+= -I.
-CLEANFILES+= vers.c vers.o ${PROG}.list ${PROG}.bin ${PROG}.sym ${PROG}.help
+CLEANFILES= vers.c loader loader.list loader.bin loader.sym loader.help
CFLAGS+= -Wall
LDFLAGS= -nostdlib -static -Ttext 0x0
@@ -57,26 +54,7 @@ LDFLAGS= -nostdlib -static -Ttext 0x0
LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a
CFLAGS+= -I${.CURDIR}/..
-# where to get libstand from
-#XXX need a better way to do this
-LIBSTAND= ${.CURDIR}/../../../../lib/libstand/libstand.a
-.if !exists(${LIBSTAND})
-LIBSTAND= ${.OBJDIR}/../../../../lib/libstand/libstand.a
-.if !exists(${LIBSTAND})
-LIBSTAND= -lstand
-.endif
-.endif
-CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/
-
# BTX components
-.if exists(${.OBJDIR}/../btx)
-BTXDIR= ${.OBJDIR}/../btx
-.else
-BTXDIR= ${.CURDIR}/../btx
-.endif
-BTXLDR= ${BTXDIR}/btxldr/btxldr
-BTXKERN= ${BTXDIR}/btx/btx
-BTXCRT= ${BTXDIR}/lib/crt0.o
CFLAGS+= -I${.CURDIR}/../btx/lib
# BTX is expecting ELF components
@@ -86,48 +64,40 @@ CFLAGS+= -elf
#CFLAGS+= -g
#LDFLAGS+= -g
-vers.o: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
+# Pick up ../Makefile.inc early.
+.include <bsd.init.mk>
+
+vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
- ${CC} -c vers.c
-${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
+loader: loader.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \
- -b ${BTXKERN} ${PROG}.bin
+ -b ${BTXKERN} loader.bin
# /usr/bin/kzip ${.TARGET}
# mv ${.TARGET}.kz ${.TARGET}
-${PROG}.bin: ${PROG}.sym
+loader.bin: loader.sym
cp ${.ALLSRC} ${.TARGET}
strip -R .comment -R .note ${.TARGET}
-${PROG}.help: help.common help.pc98
+loader.help: help.common help.pc98
cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET}
.PATH: ${.CURDIR}/../../forth
-FILES= ${PROG}.help loader.4th support.4th loader.conf
+FILES= loader loader.help loader.4th support.4th loader.conf
FILES+= screen.4th frames.4th beastie.4th
+# XXX INSTALLFLAGS_loader= -b
+FILESMODE_loader= ${BINMODE} -b
FILESDIR_loader.conf= /boot/defaults
.if !exists(${DESTDIR}/boot/loader.rc)
FILES+= ${.CURDIR}/../../i386/loader/loader.rc
.endif
-.include <${.CURDIR}/../Makefile.inc>
+OBJS= ${SRCS:N*.h:R:S/$/.o/g}
-# Cannot use ${OBJS} above this line
-.include <bsd.prog.mk>
-
-${PROG}.sym: ${OBJS} ${LIBPC98} ${LIBSTAND} ${LIBFICL} vers.o
- ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} vers.o \
+loader.sym: ${OBJS} ${LIBFICL} ${LIBPC98} ${LIBSTAND}
+ ${CC} ${LDFLAGS} -o ${.TARGET} ${BTXCRT} ${OBJS} \
${LIBFICL} ${LIBPC98} ${LIBSTAND}
-# If it's not there, don't consider it a target
-.if exists(${.CURDIR}/../../../i386/include)
-beforedepend ${OBJS}: machine
-
-machine:
- ln -sf ${.CURDIR}/../../../i386/include machine
-
-.endif
-
-CLEANFILES+= machine
+.include <bsd.prog.mk>
OpenPOWER on IntegriCloud