NetBSD/sys/arch/i386/stand/Makefile.booters

77 lines
2.3 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile.booters,v 1.6 1997/07/15 13:02:04 drochner Exp $
BINDIR= /usr/mdec
1997-04-17 11:27:46 +04:00
STRIPFLAG=
BINMODE=444
.PATH: ${.CURDIR}/../lib/crt/bootsect ${.CURDIR}/../lib
BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o bios_disk.o diskbuf.o
.PATH: ${.CURDIR}/../lib/crt/rom
ROMSTART= start_rom.o
.if exists(${.CURDIR}/../genprom/obj)
GENPROM= ${.CURDIR}/../genprom/obj/genprom
.else
GENPROM= ${.CURDIR}/../genprom/genprom
.endif
.PATH: ${.CURDIR}/../lib/crt/dos
DOSSTART= start_dos.o doscommain.o exec_fromdos.o
CPPFLAGS += -I${.OBJDIR} -I$S -I${.CURDIR}/../lib -I$S/lib/libsa
CPPFLAGS+= -D_STANDALONE
.BEGIN: ${.OBJDIR}/machine
depend all: ${.OBJDIR}/machine
CLEANFILES+= ${.OBJDIR}/machine
${.OBJDIR}/machine::
-rm $@
ln -s $S/arch/i386/include $@
.include <bsd.prog.mk>
### find out what to use for libkern
KERN_AS= library
# XXX only bzero is missing in libkern, but we have to list all we need
KERNMISCMAKEFLAGS= "SRCS=bzero.S bcmp.S strchr.c strncpy.c strcmp.S __main.c"
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}
### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}
### find out what to use for libsa
SA_AS= library
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}
### find out what to use for libi386
I386DIR= ${.CURDIR}/../lib # XXX
.include "${I386DIR}/Makefile.inc"
LIBI386= ${I386LIB}
${PROG}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
${LD} -o ${PROG}.sym -M -e _start -N -Ttext 0 $(BSSTART) $(OBJS) \
${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${PROG}.list
${PROG}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
${LD} -o ${PROG}.sym -M -e _start -N -Ttext ${RELOC} $(ROMSTART) $(OBJS) \
${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${PROG}.list
cp ${PROG}.sym ${PROG}.bin
strip ${PROG}.bin
dd if=${PROG}.bin ibs=32 skip=1 | ${GENPROM} $(ROM_SIZE) > ${PROG}.rom || (rm ${PROG}.rom; false)
rm -f ${PROG}.bin
${PROG}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
${LD} -o ${PROG}.sym -M -e _start -N -Ttext 0x100 $(DOSSTART) $(OBJS) \
${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${PROG}.list
cp ${PROG}.sym ${PROG}.bin
strip ${PROG}.bin
dd if=${PROG}.bin of=${PROG}.com ibs=32 skip=1 obs=1024b
rm -f ${PROG}.bin
${GENPROM}:
@echo "genprom" missing
@false