Makefile.booters revision 1.27
1# $NetBSD: Makefile.booters,v 1.27 2001/08/18 12:53:58 enami Exp $ 2 3BINDIR= /usr/mdec 4STRIPFLAG= 5BINMODE=444 6 7I386_STAND_DIR?= $S/arch/i386/stand 8 9.PATH: ${I386_STAND_DIR}/lib/crt/bootsect ${I386_STAND_DIR}/lib 10BSSTART= start_bootsect.o fraglist.o bootsectmain.o biosdisk_ll.o bios_disk.o diskbuf.o 11.PATH: ${I386_STAND_DIR}/lib/crt/rom 12ROMSTART= start_rom.o 13GENPROMDIR= ${I386_STAND_DIR}/genprom 14.PATH: ${I386_STAND_DIR}/lib/crt/dos 15DOSSTART= start_dos.o doscommain.o 16 17CPPFLAGS += -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa 18CPPFLAGS+= -D_STANDALONE 19 20CLEANFILES+= vers.c ${BASE}.list 21SRCS+= vers.c 22 23.BEGIN: machine 24.NOPATH: machine 25realdepend realall: machine 26CLEANFILES+= machine 27 28machine:: 29 -rm -f $@ 30 ln -s $S/arch/i386/include $@ 31 32${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART}: machine 33 34### find out what to use for libkern 35KERN_AS= library 36.include "${S}/lib/libkern/Makefile.inc" 37LIBKERN= ${KERNLIB} 38 39### find out what to use for libz 40Z_AS= library 41.include "${S}/lib/libz/Makefile.inc" 42LIBZ= ${ZLIB} 43 44### find out what to use for libsa 45SA_AS= library 46SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 47.include "${S}/lib/libsa/Makefile.inc" 48LIBSA= ${SALIB} 49 50### find out what to use for libi386 51I386DIR= ${I386_STAND_DIR}/lib 52.include "${I386DIR}/Makefile.inc" 53LIBI386= ${I386LIB} 54 55.include <bsd.own.mk> 56 57cleandir distclean: cleanlibdir 58 59cleanlibdir: 60 rm -rf lib 61 62.if ${OBJECT_FMT} == "ELF" 63LDFLAGS=-M -e start # -N does not work properly. 64.else 65LDFLAGS=-N -M -e _start 66.endif 67 68LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 69 70.PHONY: vers.c 71vers.c: ${VERSIONFILE} 72 sh ${S}conf/newvers_stand.sh ${.ALLSRC} 'i386' ${NEWVERSWHAT} 73 74${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 75 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \ 76 ${LIBLIST} >${BASE}.list 77 78${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 79 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \ 80 ${LIBLIST} >${BASE}.list 81 objcopy --output-target=binary ${BASE}.sym ${BASE}.bin 82 (cd ${GENPROMDIR}; ${MAKE} rom BINFILE=${.OBJDIR:Q}/${BASE:Q}.bin \ 83 ROMFILE=${.OBJDIR:Q}/${BASE:Q}.rom ROM_SIZE=${ROM_SIZE:Q}) 84 rm -f ${BASE}.bin 85 86${BASE}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} 87 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0x100 ${DOSSTART} ${OBJS} \ 88 ${LIBLIST} >${BASE}.list 89 objcopy --output-target=binary ${BASE}.sym ${BASE}.com 90 91.include <bsd.prog.mk> 92