Makefile.booters revision 1.32
1# $NetBSD: Makefile.booters,v 1.32 2002/02/17 20:03:06 thorpej Exp $ 2 3.include <bsd.own.mk> 4 5STRIPFLAG= 6BINMODE=444 7 8DBG= -Os 9 10I386_STAND_DIR?= $S/arch/i386/stand 11 12.PATH: ${I386_STAND_DIR}/lib/crt/bootsect ${I386_STAND_DIR}/lib 13BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o \ 14 bios_disk.o diskbuf.o 15 16.PATH: ${I386_STAND_DIR}/lib/crt/rom 17ROMSTART= start_rom.o 18GENPROMDIR= ${I386_STAND_DIR}/genprom 19GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR} 20GENPROM= ${GENPROMOBJDIR}/genprom 21 22.PATH: ${I386_STAND_DIR}/lib/crt/dos 23DOSSTART= start_dos.o doscommain.o 24 25.PATH: ${I386_STAND_DIR}/lib/crt/pxe 26PXESTART= start_pxe.o 27 28CPPFLAGS += -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa 29CPPFLAGS+= -D_STANDALONE 30 31CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list 32SRCS+= vers.c 33 34.if !make(obj) && !make(clean) && !make(cleandir) 35.BEGIN: machine 36.NOPATH: machine 37.endif 38 39realdepend realall: machine 40CLEANFILES+= machine 41 42machine:: 43 -rm -f $@ 44 ln -s $S/arch/i386/include $@ 45 46${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART} ${PXESTART}: machine 47 48### find out what to use for libkern 49KERN_AS= library 50.include "${S}/lib/libkern/Makefile.inc" 51LIBKERN= ${KERNLIB} 52 53### find out what to use for libz 54Z_AS= library 55.include "${S}/lib/libz/Makefile.inc" 56LIBZ= ${ZLIB} 57 58### find out what to use for libsa 59SA_AS= library 60SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 61.include "${S}/lib/libsa/Makefile.inc" 62LIBSA= ${SALIB} 63 64### find out what to use for libi386 65I386DIR= ${I386_STAND_DIR}/lib 66.include "${I386DIR}/Makefile.inc" 67LIBI386= ${I386LIB} 68 69cleandir distclean: cleanlibdir 70 71cleanlibdir: 72 rm -rf lib 73 74.if ${OBJECT_FMT} == "ELF" 75LDFLAGS=-M -e start # -N does not work properly. 76.else 77LDFLAGS=-N -M -e _start 78.endif 79 80LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 81 82.PHONY: vers.c 83vers.c: ${VERSIONFILE} 84 sh ${S}conf/newvers_stand.sh ${.ALLSRC} 'i386' ${NEWVERSWHAT} 85 86CLEANFILES+= ${BASE}.sym 87${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 88 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \ 89 ${LIBLIST} >${BASE}.list 90 91CLEANFILES+= ${BASE}.rom 92${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 93 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \ 94 ${LIBLIST} >${BASE}.list 95 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 96 ${GENPROM} ${ROM_SIZE} < ${BASE}.bin > ${BASE}.rom || \ 97 rm -f ${BASE}.rom 98 rm -f ${BASE}.bin 99 100CLEANFILES+= ${BASE}.com 101${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 102 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \ 103 ${LIBLIST} >${BASE}.list 104 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.com 105 106CLEANFILES+= ${BASE}.bin 107${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 108 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${STARTFILE} ${OBJS} \ 109 ${LIBLIST} > ${BASE}.list 110 ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin 111 112.include <bsd.prog.mk> 113