78 lines
2.4 KiB
Makefile
78 lines
2.4 KiB
Makefile
# $NetBSD: Makefile.booters,v 1.9 1997/09/28 11:47:29 drochner Exp $
|
|
|
|
BINDIR= /usr/mdec
|
|
STRIPFLAG=
|
|
BINMODE=444
|
|
|
|
I386_STAND_DIR?= $S/arch/i386/stand
|
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/bootsect ${I386_STAND_DIR}/lib
|
|
BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o bios_disk.o diskbuf.o
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/rom
|
|
ROMSTART= start_rom.o
|
|
GENPROMDIR= ${I386_STAND_DIR}/genprom
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/dos
|
|
DOSSTART= start_dos.o doscommain.o exec_fromdos.o
|
|
|
|
CPPFLAGS += -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
|
|
CPPFLAGS+= -D_STANDALONE
|
|
|
|
CLEANFILES+= vers.c vers.o ${BASE}.list
|
|
|
|
.BEGIN: ${.OBJDIR}/machine
|
|
depend all: ${.OBJDIR}/machine
|
|
CLEANFILES+= ${.OBJDIR}/machine
|
|
|
|
${.OBJDIR}/machine::
|
|
-rm $@
|
|
ln -s $S/arch/i386/include $@
|
|
|
|
### 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= ${I386_STAND_DIR}/lib
|
|
.include "${I386DIR}/Makefile.inc"
|
|
LIBI386= ${I386LIB}
|
|
|
|
vers.o:
|
|
sh ${I386_STAND_DIR}/newvers.sh ${.CURDIR}/version ${NEWVERSWHAT}
|
|
${COMPILE.c} vers.c
|
|
|
|
${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o
|
|
${LD} -o ${BASE}.sym -M -e _start -N -Ttext 0 $(BSSTART) $(OBJS) \
|
|
vers.o ${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${BASE}.list
|
|
|
|
${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o
|
|
${LD} -o ${BASE}.sym -M -e _start -N -Ttext ${RELOC} $(ROMSTART) $(OBJS) \
|
|
vers.o ${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${BASE}.list
|
|
cp ${BASE}.sym ${BASE}.bin
|
|
strip ${BASE}.bin
|
|
(cd ${GENPROMDIR}; ${MAKE} rom BINFILE=${.OBJDIR:Q}/${BASE:Q}.bin \
|
|
ROMFILE=${.OBJDIR:Q}/${BASE:Q}.rom ROM_SIZE=${ROM_SIZE:Q})
|
|
rm -f ${BASE}.bin
|
|
|
|
${BASE}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o
|
|
${LD} -o ${BASE}.sym -M -e _start -N -Ttext 0x100 $(DOSSTART) $(OBJS) \
|
|
vers.o ${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} >${BASE}.list
|
|
cp ${BASE}.sym ${BASE}.bin
|
|
strip ${BASE}.bin
|
|
dd if=${BASE}.bin of=${BASE}.com ibs=32 skip=1 obs=1024b
|
|
rm -f ${BASE}.bin
|
|
|
|
.include <bsd.prog.mk>
|