MFi386: Cleanups to sys/boot makefiles.

This commit is contained in:
Yoshihiro Takahashi 2004-02-07 12:19:44 +00:00
parent 50a51e39a9
commit cc78dccee9
9 changed files with 71 additions and 105 deletions

View File

@ -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

View File

@ -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
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
# 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
${BOOT}: ${BOOT}.bin
cat ${BOOT}.bin /dev/zero | dd of=${BOOT} bs=1 count=7168
boot0.5.bin: boot0.5.out
objcopy -S -O binary boot0.5.out ${.TARGET}
${BOOT}.bin: ${BOOT}.out
objcopy -S -O binary ${BOOT}.out ${.TARGET}
boot0.5.out: ${OBJS}
${LD} -N -e start -Ttext ${ORG} -o ${.TARGET} ${OBJS}
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>

View File

@ -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>

View File

@ -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 \

View File

@ -0,0 +1,3 @@
# $FreeBSD$
.include "../Makefile.inc"

View File

@ -19,5 +19,4 @@ btxldr.o: btxldr.s
CLEANFILES+= btxldr btxldr.out btxldr.o
.include <${.CURDIR}/../../Makefile.inc>
.include <bsd.prog.mk>

View File

@ -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>

View File

@ -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>

View File

@ -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
sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT}
${CC} -c vers.c
# Pick up ../Makefile.inc early.
.include <bsd.init.mk>
${PROG}: ${PROG}.bin ${BTXLDR} ${BTXKERN} ${BTXCRT}
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}
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>