MFi386: Factor out -nostdlib and use PROG.
This commit is contained in:
parent
801e658cdd
commit
95fdeae578
@ -6,6 +6,7 @@ BINDIR?= /boot
|
||||
|
||||
LOADER_ADDRESS?=0x100000
|
||||
CFLAGS+= -ffreestanding -mpreferred-stack-boundary=2
|
||||
LDFLAGS+= -nostdlib
|
||||
|
||||
# BTX components
|
||||
.if exists(${.OBJDIR}/../btx)
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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=
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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 PC98=1
|
||||
AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT}
|
||||
|
||||
kgzldr.o: ${OBJS}
|
||||
${CC} ${LDFLAGS} -o ${.TARGET} ${OBJS}
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user