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