1997-07-15 17:02:04 +04:00
|
|
|
# $NetBSD: Makefile.booters,v 1.6 1997/07/15 13:02:04 drochner Exp $
|
1997-03-14 05:40:29 +03:00
|
|
|
|
|
|
|
BINDIR= /usr/mdec
|
1997-04-17 11:27:46 +04:00
|
|
|
STRIPFLAG=
|
1997-03-14 05:40:29 +03:00
|
|
|
BINMODE=444
|
|
|
|
|
|
|
|
.PATH: ${.CURDIR}/../lib/crt/bootsect ${.CURDIR}/../lib
|
1997-06-13 17:12:29 +04:00
|
|
|
BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o bios_disk.o diskbuf.o
|
1997-03-14 05:40:29 +03:00
|
|
|
.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
|
1997-06-13 21:49:22 +04:00
|
|
|
DOSSTART= start_dos.o doscommain.o exec_fromdos.o
|
1997-03-14 05:40:29 +03:00
|
|
|
|
1997-07-15 17:02:04 +04:00
|
|
|
CPPFLAGS += -I${.OBJDIR} -I$S -I${.CURDIR}/../lib -I$S/lib/libsa
|
1997-06-26 23:03:32 +04:00
|
|
|
CPPFLAGS+= -D_STANDALONE
|
1997-03-14 05:40:29 +03:00
|
|
|
|
1997-07-15 17:02:04 +04:00
|
|
|
.BEGIN: ${.OBJDIR}/machine
|
|
|
|
depend all: ${.OBJDIR}/machine
|
|
|
|
CLEANFILES+= ${.OBJDIR}/machine
|
|
|
|
|
|
|
|
${.OBJDIR}/machine::
|
|
|
|
-rm $@
|
|
|
|
ln -s $S/arch/i386/include $@
|
|
|
|
|
1997-03-14 05:40:29 +03:00
|
|
|
.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
|