2002-02-16 06:37:39 +03:00
|
|
|
# $NetBSD: Makefile.booters,v 1.31 2002/02/16 03:37:39 thorpej 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
|
|
|
|
|
2001-09-24 03:43:29 +04:00
|
|
|
DBG= -Os
|
|
|
|
|
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
|
2002-02-16 06:37:39 +03:00
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/pxe
|
|
|
|
PXESTART= start_pxe.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
|
|
|
|
2000-07-13 01:05:35 +04:00
|
|
|
CLEANFILES+= vers.c ${BASE}.list
|
|
|
|
SRCS+= vers.c
|
1997-07-26 05:50:36 +04:00
|
|
|
|
2001-11-22 03:14:20 +03:00
|
|
|
.if !make(obj) && !make(clean) && !make(cleandir)
|
2000-01-23 19:44:18 +03:00
|
|
|
.BEGIN: machine
|
|
|
|
.NOPATH: machine
|
2001-11-22 03:14:20 +03:00
|
|
|
.endif
|
|
|
|
|
2000-01-23 19:44:18 +03:00
|
|
|
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 $@
|
|
|
|
|
2002-02-16 06:37:39 +03:00
|
|
|
${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART} ${PXESTART}: 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}
|
|
|
|
|
2001-08-18 16:53:58 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
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
|
|
|
.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}
|
|
|
|
|
2000-07-13 01:05:35 +04:00
|
|
|
.PHONY: vers.c
|
|
|
|
vers.c: ${VERSIONFILE}
|
|
|
|
sh ${S}conf/newvers_stand.sh ${.ALLSRC} 'i386' ${NEWVERSWHAT}
|
1997-07-26 05:50:36 +04:00
|
|
|
|
2000-07-13 01:05:35 +04:00
|
|
|
${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
1999-03-13 23:58:25 +03:00
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \
|
2000-07-13 01:05:35 +04:00
|
|
|
${LIBLIST} >${BASE}.list
|
1997-09-28 15:47:29 +04:00
|
|
|
|
2000-07-13 01:05:35 +04:00
|
|
|
${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
1999-03-13 23:58:25 +03:00
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \
|
2000-07-13 01:05:35 +04:00
|
|
|
${LIBLIST} >${BASE}.list
|
2001-09-22 07:34:17 +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
|
|
|
|
|
2000-07-13 01:05:35 +04:00
|
|
|
${BASE}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
1999-03-13 23:58:25 +03:00
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0x100 ${DOSSTART} ${OBJS} \
|
2000-07-13 01:05:35 +04:00
|
|
|
${LIBLIST} >${BASE}.list
|
2001-09-22 07:34:17 +04:00
|
|
|
${OBJCOPY} --output-target=binary ${BASE}.sym ${BASE}.com
|
1997-09-28 15:47:29 +04:00
|
|
|
|
2002-02-16 06:37:39 +03:00
|
|
|
${BASE}.pxe: ${PXESTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${PXESTART} ${OBJS} \
|
|
|
|
${LIBLIST} > ${BASE}.list
|
|
|
|
${OBJCOPY} --output-target=binary ${BASE}.sym ${BASE}.pxe
|
|
|
|
|
1997-09-28 15:47:29 +04:00
|
|
|
.include <bsd.prog.mk>
|