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

90 lines
2.5 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile.booters,v 1.24 1999/07/08 14:32:28 drochner Exp $
BINDIR= /usr/mdec
1997-04-17 11:27:46 +04:00
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
CPPFLAGS += -nostdinc -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 -f $@
ln -s $S/arch/i386/include $@
${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART}: ${.OBJDIR}/machine
### find out what to use for libkern
KERN_AS= library
.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
1999-04-28 13:13:51 +04:00
SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
.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}
cleandir distclean: cleanlibdir
cleanlibdir:
rm -rf lib
.include <bsd.own.mk>
.if ${OBJECT_FMT} == "ELF"
LDFLAGS=-M -e start # -N does not work properly.
.else
LDFLAGS=-N -M -e _start
.endif
1999-04-28 13:13:51 +04:00
LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA}
vers.o: ${VERSIONFILE}
sh ${I386_STAND_DIR}/newvers.sh ${.ALLSRC} ${NEWVERSWHAT}
${COMPILE.c} vers.c
${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o
1999-03-13 23:58:25 +03:00
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \
1999-04-28 13:13:51 +04:00
vers.o ${LIBLIST} >${BASE}.list
${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o
1999-03-13 23:58:25 +03:00
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \
1999-04-28 13:13:51 +04:00
vers.o ${LIBLIST} >${BASE}.list
objcopy --output-target=binary ${BASE}.sym ${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
1999-03-13 23:58:25 +03:00
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0x100 ${DOSSTART} ${OBJS} \
1999-04-28 13:13:51 +04:00
vers.o ${LIBLIST} >${BASE}.list
objcopy --output-target=binary ${BASE}.sym ${BASE}.com
.include <bsd.prog.mk>