2002-03-20 01:03:37 +03:00
|
|
|
# $NetBSD: Makefile.booters,v 1.33 2002/03/19 22:03:37 thorpej Exp $
|
2002-02-17 23:03:05 +03:00
|
|
|
|
|
|
|
.include <bsd.own.mk>
|
1997-03-14 05:40:29 +03:00
|
|
|
|
1997-04-17 11:27:46 +04:00
|
|
|
STRIPFLAG=
|
1997-03-14 05:40:29 +03:00
|
|
|
BINMODE=444
|
|
|
|
|
2002-03-20 01:03:37 +03:00
|
|
|
# Make sure we override any optimization options specified by the
|
|
|
|
# user.
|
|
|
|
COPTS+= -Os -mcpu=i386
|
2001-09-24 03:43:29 +04:00
|
|
|
|
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
|
2002-02-17 23:03:05 +03: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
|
2002-02-17 23:03:05 +03:00
|
|
|
GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR}
|
|
|
|
GENPROM= ${GENPROMOBJDIR}/genprom
|
|
|
|
|
1997-08-20 20:53:30 +04:00
|
|
|
.PATH: ${I386_STAND_DIR}/lib/crt/dos
|
1999-01-30 20:43:10 +03:00
|
|
|
DOSSTART= start_dos.o doscommain.o
|
2002-02-17 23:03:05 +03:00
|
|
|
|
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
|
|
|
|
2002-02-17 23:03:05 +03:00
|
|
|
CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list
|
2000-07-13 01:05:35 +04:00
|
|
|
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}
|
|
|
|
|
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
|
|
|
|
2002-02-17 23:03:05 +03:00
|
|
|
CLEANFILES+= ${BASE}.sym
|
|
|
|
${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
|
|
|
|
${LIBLIST} >${BASE}.list
|
|
|
|
|
|
|
|
CLEANFILES+= ${BASE}.rom
|
|
|
|
${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
|
|
|
|
${LIBLIST} >${BASE}.list
|
|
|
|
${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
|
|
|
|
${GENPROM} ${ROM_SIZE} < ${BASE}.bin > ${BASE}.rom || \
|
|
|
|
rm -f ${BASE}.rom
|
1997-09-28 15:47:29 +04:00
|
|
|
rm -f ${BASE}.bin
|
|
|
|
|
2002-02-17 23:03:05 +03:00
|
|
|
CLEANFILES+= ${BASE}.com
|
|
|
|
${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
|
|
|
|
${LIBLIST} >${BASE}.list
|
|
|
|
${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com
|
1997-09-28 15:47:29 +04:00
|
|
|
|
2002-02-17 23:03:05 +03:00
|
|
|
CLEANFILES+= ${BASE}.bin
|
|
|
|
${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
|
|
|
|
${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \
|
2002-02-16 06:37:39 +03:00
|
|
|
${LIBLIST} > ${BASE}.list
|
2002-02-17 23:03:05 +03:00
|
|
|
${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin
|
2002-02-16 06:37:39 +03:00
|
|
|
|
1997-09-28 15:47:29 +04:00
|
|
|
.include <bsd.prog.mk>
|