Makefile.booters revision 1.25
1# $NetBSD: Makefile.booters,v 1.25 2000/01/23 16:44:18 mycroft 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 vers.o ${BASE}.list 21 22.BEGIN: machine 23.NOPATH: machine 24realdepend realall: machine 25CLEANFILES+= machine 26 27machine:: 28 -rm -f $@ 29 ln -s $S/arch/i386/include $@ 30 31${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART}: machine 32 33### find out what to use for libkern 34KERN_AS= library 35.include "${S}/lib/libkern/Makefile.inc" 36LIBKERN= ${KERNLIB} 37 38### find out what to use for libz 39Z_AS= library 40.include "${S}/lib/libz/Makefile.inc" 41LIBZ= ${ZLIB} 42 43### find out what to use for libsa 44SA_AS= library 45SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 46.include "${S}/lib/libsa/Makefile.inc" 47LIBSA= ${SALIB} 48 49### find out what to use for libi386 50I386DIR= ${I386_STAND_DIR}/lib 51.include "${I386DIR}/Makefile.inc" 52LIBI386= ${I386LIB} 53 54cleandir distclean: cleanlibdir 55 56cleanlibdir: 57 rm -rf lib 58 59.include <bsd.own.mk> 60 61.if ${OBJECT_FMT} == "ELF" 62LDFLAGS=-M -e start # -N does not work properly. 63.else 64LDFLAGS=-N -M -e _start 65.endif 66 67LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 68 69vers.o: ${VERSIONFILE} 70 sh ${I386_STAND_DIR}/newvers.sh ${.ALLSRC} ${NEWVERSWHAT} 71 ${COMPILE.c} vers.c 72 73${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o 74 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \ 75 vers.o ${LIBLIST} >${BASE}.list 76 77${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o 78 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \ 79 vers.o ${LIBLIST} >${BASE}.list 80 objcopy --output-target=binary ${BASE}.sym ${BASE}.bin 81 (cd ${GENPROMDIR}; ${MAKE} rom BINFILE=${.OBJDIR:Q}/${BASE:Q}.bin \ 82 ROMFILE=${.OBJDIR:Q}/${BASE:Q}.rom ROM_SIZE=${ROM_SIZE:Q}) 83 rm -f ${BASE}.bin 84 85${BASE}.com: ${DOSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o 86 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0x100 ${DOSSTART} ${OBJS} \ 87 vers.o ${LIBLIST} >${BASE}.list 88 objcopy --output-target=binary ${BASE}.sym ${BASE}.com 89 90.include <bsd.prog.mk> 91