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