Makefile.booters revision 1.23
1# $NetBSD: Makefile.booters,v 1.23 1999/05/11 19:43:09 drochner 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${OBJS} ${BSSTART} ${ROMSTART} ${DOSSTART}: ${.OBJDIR}/machine 31 32### find out what to use for libkern 33KERN_AS= library 34.include "${S}/lib/libkern/Makefile.inc" 35LIBKERN= ${KERNLIB} 36 37### find out what to use for libz 38Z_AS= library 39.include "${S}/lib/libz/Makefile.inc" 40LIBZ= ${ZLIB} 41 42### find out what to use for libsa 43SA_AS= library 44SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" 45.include "${S}/lib/libsa/Makefile.inc" 46LIBSA= ${SALIB} 47 48### find out what to use for libi386 49I386DIR= ${I386_STAND_DIR}/lib 50.include "${I386DIR}/Makefile.inc" 51LIBI386= ${I386LIB} 52 53cleandir distclean: cleanlibdir 54 55cleanlibdir: 56 rm -rf lib 57 58.include <bsd.own.mk> 59 60.if ${OBJECT_FMT} == "ELF" 61LDFLAGS=-M -e start # -N does not work properly. 62.else 63LDFLAGS=-N -M -e _start 64.endif 65 66LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} 67 68vers.o: ${VERSIONFILE} 69 sh ${I386_STAND_DIR}/newvers.sh ${.ALLSRC} ${NEWVERSWHAT} 70 ${COMPILE.c} vers.c 71 72${BASE}.sym: ${BSSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o 73 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext 0 ${BSSTART} ${OBJS} \ 74 vers.o ${LIBLIST} >${BASE}.list 75 76${BASE}.rom: ${GENPROM} ${ROMSTART} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} vers.o 77 ${LD} -o ${BASE}.sym ${LDFLAGS} -Ttext ${RELOC} ${ROMSTART} ${OBJS} \ 78 vers.o ${LIBLIST} >${BASE}.list 79 cp ${BASE}.sym ${BASE}.bin 80 strip ${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 cp ${BASE}.sym ${BASE}.bin 89 strip ${BASE}.bin 90 dd if=${BASE}.bin of=${BASE}.com ibs=32 skip=1 obs=1024b 91 rm -f ${BASE}.bin 92 93.include <bsd.prog.mk> 94