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