2000-01-23 19:44:18 +03:00
|
|
|
# $NetBSD: Makefile.booters,v 1.25 2000/01/23 16:44:18 mycroft 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
|
|
|
|
|
1997-08-20 20:53:30 +04:00
|
|
|
I386_STAND_DIR?= $S/arch/i386/stand
|
|
|
|
|
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/bootsect ${I386_STAND_DIR}/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-08-20 20:53:30 +04:00
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/rom
|
1999-01-30 20:43:10 +03:00
|
|
|
ROMSTART= start_rom.o
|
1997-08-20 20:53:30 +04:00
|
|
|
GENPROMDIR= ${I386_STAND_DIR}/genprom
|
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/dos
|
1999-01-30 20:43:10 +03:00
|
|
|
DOSSTART= start_dos.o doscommain.o
|
1997-03-14 05:40:29 +03:00
|
|
|
|
1998-03-27 04:32:53 +03:00
|
|
|
CPPFLAGS += -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/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-09-28 15:47:29 +04:00
|
|
|
CLEANFILES+= vers.c vers.o ${BASE}.list
|
1997-07-26 05:50:36 +04:00
|
|
|
|
2000-01-23 19:44:18 +03:00
|
|
|
.BEGIN: machine
|
|
|
|
.NOPATH: machine
|
|
|
|
realdepend realall: machine
|
|
|
|
CLEANFILES+= machine
|
1997-07-15 17:02:04 +04:00
|
|
|
|
2000-01-23 19:44:18 +03:00
|
|
|
machine::
|
1997-10-19 01:46:27 +04:00
|
|
|
-rm -f $@
|
1997-07-15 17:02:04 +04:00
|
|
|
ln -s $S/arch/i386/include $@
|
|
|
|
|
2000-01-23 19:44:18 +03:00
|
|
|
${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART}: machine
|
1999-05-11 23:43:09 +04:00
|
|
|
|
1997-03-14 05:40:29 +03:00
|
|
|
### 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"
|
1997-03-14 05:40:29 +03:00
|
|
|
.include "${S}/lib/libsa/Makefile.inc"
|
|
|
|
LIBSA= ${SALIB}
|
|
|
|
|
|
|
|
### find out what to use for libi386
|
1997-08-20 20:53:30 +04:00
|
|
|
I386DIR= ${I386_STAND_DIR}/lib
|
1997-03-14 05:40:29 +03:00
|
|
|
.include "${I386DIR}/Makefile.inc"
|
|
|
|
LIBI386= ${I386LIB}
|
|
|
|
|
1999-02-07 21:25:54 +03:00
|
|
|
cleandir distclean: cleanlibdir
|
1999-02-07 16:39:36 +03:00
|
|
|
|
|
|
|
cleanlibdir:
|
|
|
|
rm -rf lib
|
|
|
|
|
1999-01-30 20:43:10 +03:00
|
|
|
.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}
|
|
|
|
|
1999-03-14 03:04:06 +03:00
|
|
|
vers.o: ${VERSIONFILE}
|
1999-03-12 19:07:57 +03:00
|
|
|
sh ${I386_STAND_DIR}/newvers.sh ${.ALLSRC} ${NEWVERSWHAT}
|
1997-07-26 05:50:36 +04:00
|
|
|
${COMPILE.c} vers.c
|
|
|
|
|
1997-09-28 15:47:29 +04:00
|
|
|
${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
|
1997-09-28 15:47:29 +04:00
|
|
|
|
|
|
|
${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
|
1999-07-08 18:32:28 +04:00
|
|
|
objcopy --output-target=binary ${BASE}.sym ${BASE}.bin
|
1997-09-28 15:47:29 +04:00
|
|
|
(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
|
1999-07-08 18:32:28 +04:00
|
|
|
objcopy --output-target=binary ${BASE}.sym ${BASE}.com
|
1997-09-28 15:47:29 +04:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|