Makefile.booters revision 1.40
11.40Sjdolecek# $NetBSD: Makefile.booters,v 1.40 2002/12/09 12:42:18 jdolecek Exp $ 21.5Smellon 31.27Ssimonb# $S must correspond to the top of the 'sys' tree 41.27SsimonbS= ${.CURDIR}/../../../.. 51.27Ssimonb 61.28Smycroft.BEGIN: machine pmax mips 71.28Smycroft${PROG} realdepend realall: machine pmax mips 81.27SsimonbCLEANFILES+= machine pmax mips 91.28Smycroftmachine: 101.18Ssimonb -rm -f ${.TARGET} 111.18Ssimonb ln -s $S/arch/${MACHINE}/include ${.TARGET} 121.28Smycroftpmax: 131.27Ssimonb -rm -f ${.TARGET} 141.27Ssimonb ln -s $S/arch/${MACHINE}/include ${.TARGET} 151.28Smycroftmips: 161.18Ssimonb -rm -f ${.TARGET} 171.18Ssimonb ln -s $S/arch/mips/include mips 181.1Sderaadt 191.27SsimonbBINMODE?= 444 201.34Sgmcgarry 211.27Ssimonb.PATH: ${.CURDIR}/../common 221.40SjdolecekAFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls 231.27Ssimonb# -I${.CURDIR}/../.. done by Makefile.inc 241.32SsimonbCPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES \ 251.32Ssimonb -I${.OBJDIR} -I${S} 261.27Ssimonb# compiler flags for smallest code size 271.39SjdolecekCFLAGS= -ffreestanding -Os -g -mmemcpy -mno-abicalls -G 128 281.32SsimonbOFORMAT= --oformat elf32-littlemips 291.32SsimonbLDBUG= -T $S/arch/mips/conf/stand.ldscript 301.27Ssimonb 311.27SsimonbNETBSD_VERS!= sh ${.CURDIR}/../../../../conf/osrelease.sh 321.27SsimonbCPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 331.27Ssimonb 341.27SsimonbPRIMARY_LOAD_ADDRESS?= 0x80700000 351.27SsimonbSECONDARY_LOAD_ADDRESS?=0x80710000 361.37Sjdolecek 371.38SsimonbNOMAN= # defined 381.27Ssimonb 391.27Ssimonb.if defined(PRIMARY_PROG) 401.27SsimonbPROG= ${PRIMARY_PROG} 411.27SsimonbSRCS = start.S bootxx.c callvec.c 421.27SsimonbSRCS+= devopen.c conf.c rz.c 431.27SsimonbSRCS+= bootinit.S bootread.S clear_cache.S printf.S 441.27Ssimonb 451.27SsimonbLOAD_ADDRESS= ${PRIMARY_LOAD_ADDRESS} 461.27Ssimonb# Pick a number, any number... 471.27SsimonbPRIMARY_MAX_TOTAL!= expr 16 \* 1024 481.27Ssimonb 491.27SsimonbCPPFLAGS+= -DPRIMARY_BOOTBLOCK \ 501.27Ssimonb -DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \ 511.27Ssimonb -DNO_GETCHAR \ 521.27Ssimonb -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \ 531.27Ssimonb -DLIBSA_NO_FS_CLOSE \ 541.27Ssimonb -DLIBSA_NO_DEV_CLOSE \ 551.27Ssimonb -DLIBSA_SINGLE_DEVICE=rz \ 561.27Ssimonb -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \ 571.27Ssimonb -DLIBSA_NO_TWIDDLE \ 581.27Ssimonb -DLIBSA_NO_FD_CHECKING \ 591.27Ssimonb -DLIBSA_NO_RAW_ACCESS \ 601.27Ssimonb -DLIBSA_NO_DISKLABEL_MSGS \ 611.27Ssimonb -DALLOC_FIRST_FIT \ 621.27Ssimonb -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET 631.27Ssimonb 641.27SsimonbCHECKSIZE_CMD?= SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh 651.27Ssimonb 661.27Ssimonb.elif defined(SECONDARY_PROG) 671.27SsimonbPROG= ${SECONDARY_PROG} 681.27SsimonbLOAD_ADDRESS= ${SECONDARY_LOAD_ADDRESS} 691.27SsimonbCPPFLAGS+= -DSECONDARY_BOOTBLOCK 701.30SjdolecekSRCS+= vers.c 711.30SjdolecekCLEANFILES+= vers.c 721.27Ssimonb.else 731.27Ssimonb# XXX ? 741.27Ssimonb.endif 751.18Ssimonb 761.27Ssimonb### find out what to use for libkern 771.27SsimonbKERN_AS= library 781.27Ssimonb.include "${S}/lib/libkern/Makefile.inc" 791.27SsimonbLIBKERN= ${KERNLIB} 801.18Ssimonb 811.18Ssimonb### find out what to use for libz 821.27Ssimonb.if defined(PRIMARY_PROG) 831.27SsimonbLIBZ= 841.27Ssimonb.else 851.18SsimonbZ_AS= library 861.18Ssimonb.include "${S}/lib/libz/Makefile.inc" 871.18SsimonbLIBZ= ${ZLIB} 881.27Ssimonb.endif 891.18Ssimonb 901.27Ssimonb### find out what to use for libsa 911.27SsimonbSA_AS= library 921.27Ssimonb.if defined(PRIMARY_PROG) 931.27SsimonbSAMISCMAKEFLAGS+=SA_INCLUDE_NET=no 941.27Ssimonb.endif 951.27Ssimonb.if defined(SECONDARY_PROG) 961.27SsimonbSAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 971.33SgmcgarrySAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes 981.22Ssimonb.endif 991.27Ssimonb.include "${S}/lib/libsa/Makefile.inc" 1001.27SsimonbLIBSA= ${SALIB} 1011.18Ssimonb 1021.27SsimonbLIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} 1031.36Sgmcgarry 1041.36Sgmcgarry.include <bsd.own.mk> 1051.18Ssimonb 1061.30Sjdolecek.PHONY: vers.c 1071.30Sjdolecekvers.c: ${.CURDIR}/version 1081.30Sjdolecek sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "pmax" 1091.18Ssimonb 1101.30Sjdolecek${PROG}: machine mips pmax ${OBJS} ${LIBS} 1111.32Ssimonb ${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 1121.32Ssimonb ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS} 1131.27Ssimonb @${SIZE} ${PROG} 1141.27Ssimonb.if defined(CHECKSIZE_CMD) 1151.27Ssimonb @${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \ 1161.27Ssimonb (rm -f ${PROG} ; false) 1171.33Sgmcgarry.endif 1181.33Sgmcgarry.if defined(DO_ECOFF_BINARY) 1191.33Sgmcgarry @echo -n "Creating ECOFF binary... " 1201.33Sgmcgarry @mv ${PROG} ${PROG}.elf 1211.34Sgmcgarry @${ELF2ECOFF} ${PROG}.elf ${PROG} 1221.33Sgmcgarry @echo done. 1231.27Ssimonb.endif 1241.18Ssimonb 1251.31Stsutsui.include <bsd.prog.mk> 1261.31Stsutsui 1271.27SsimonbCLEANFILES+= ${PROG}.map 1281.20Ssimonb 1291.20Ssimonbcleandir distclean: cleanlibdir 1301.20Ssimonb 1311.20Ssimonbcleanlibdir: 1321.20Ssimonb rm -rf lib 133