Makefile.booters revision 1.33
11.33Sgmcgarry# $NetBSD: Makefile.booters,v 1.33 2002/02/23 21:43:58 gmcgarry 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.18Ssimonb
211.27Ssimonb.PATH:		${.CURDIR}/../common
221.18SsimonbAFLAGS+=	-D_LOCORE -D_KERNEL
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.27SsimonbCFLAGS=		-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.27Ssimonb
371.27Ssimonb.if defined(PRIMARY_PROG)
381.27SsimonbPROG=		${PRIMARY_PROG}
391.27SsimonbSRCS =		start.S bootxx.c callvec.c
401.27SsimonbSRCS+=		devopen.c conf.c rz.c
411.27SsimonbSRCS+=		bootinit.S bootread.S clear_cache.S printf.S
421.27Ssimonb
431.27SsimonbLOAD_ADDRESS=	${PRIMARY_LOAD_ADDRESS}
441.27Ssimonb# Pick a number, any number...
451.27SsimonbPRIMARY_MAX_TOTAL!=	expr 16 \* 1024
461.27Ssimonb
471.27SsimonbCPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
481.27Ssimonb		-DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \
491.27Ssimonb		-DNO_GETCHAR \
501.27Ssimonb		-DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \
511.27Ssimonb		-DLIBSA_NO_FS_CLOSE \
521.27Ssimonb		-DLIBSA_NO_DEV_CLOSE \
531.27Ssimonb		-DLIBSA_SINGLE_DEVICE=rz \
541.27Ssimonb		-D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \
551.27Ssimonb		-DLIBSA_NO_TWIDDLE \
561.27Ssimonb		-DLIBSA_NO_FD_CHECKING \
571.27Ssimonb		-DLIBSA_NO_RAW_ACCESS \
581.27Ssimonb		-DLIBSA_NO_DISKLABEL_MSGS \
591.27Ssimonb		-DALLOC_FIRST_FIT \
601.27Ssimonb		-DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET
611.27Ssimonb
621.27SsimonbCHECKSIZE_CMD?=	SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh
631.27Ssimonb
641.27Ssimonb.elif defined(SECONDARY_PROG)
651.27SsimonbPROG=		${SECONDARY_PROG}
661.27SsimonbLOAD_ADDRESS=	${SECONDARY_LOAD_ADDRESS}
671.27SsimonbCPPFLAGS+=	-DSECONDARY_BOOTBLOCK
681.30SjdolecekSRCS+=	vers.c
691.30SjdolecekCLEANFILES+= vers.c
701.27Ssimonb.else
711.27Ssimonb# XXX ?
721.27Ssimonb.endif
731.18Ssimonb
741.27Ssimonb### find out what to use for libkern
751.27SsimonbKERN_AS=	library
761.27Ssimonb.include "${S}/lib/libkern/Makefile.inc"
771.27SsimonbLIBKERN=	${KERNLIB}
781.18Ssimonb
791.18Ssimonb### find out what to use for libz
801.27Ssimonb.if defined(PRIMARY_PROG)
811.27SsimonbLIBZ=
821.27Ssimonb.else
831.18SsimonbZ_AS=		library
841.18Ssimonb.include "${S}/lib/libz/Makefile.inc"
851.18SsimonbLIBZ=		${ZLIB}
861.27Ssimonb.endif
871.18Ssimonb
881.27Ssimonb### find out what to use for libsa
891.27SsimonbSA_AS=		library
901.27Ssimonb.if defined(PRIMARY_PROG)
911.27SsimonbSAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
921.27Ssimonb.endif
931.27Ssimonb.if defined(SECONDARY_PROG)
941.27SsimonbSAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
951.33SgmcgarrySAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes
961.22Ssimonb.endif
971.27Ssimonb.include "${S}/lib/libsa/Makefile.inc"
981.27SsimonbLIBSA=		${SALIB}
991.18Ssimonb
1001.27SsimonbLIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
1011.18Ssimonb
1021.30Sjdolecek.PHONY: vers.c
1031.30Sjdolecekvers.c: ${.CURDIR}/version
1041.30Sjdolecek	sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "pmax"
1051.18Ssimonb
1061.30Sjdolecek${PROG}: machine mips pmax ${OBJS} ${LIBS}
1071.32Ssimonb	${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
1081.32Ssimonb	    ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS}
1091.27Ssimonb	@${SIZE} ${PROG}
1101.27Ssimonb.if defined(CHECKSIZE_CMD)
1111.27Ssimonb	@${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \
1121.27Ssimonb	    (rm -f ${PROG} ; false)
1131.33Sgmcgarry.endif
1141.33Sgmcgarry.if defined(DO_ECOFF_BINARY)
1151.33Sgmcgarry	@echo -n "Creating ECOFF binary... "
1161.33Sgmcgarry	@mv ${PROG} ${PROG}.elf
1171.33Sgmcgarry.if defined(USETOOLS)
1181.33Sgmcgarry	@${TOOLDIR}/bin/nbmips-elf2ecoff ${PROG}.elf ${PROG}
1191.33Sgmcgarry.else
1201.33Sgmcgarry	@elf2ecoff ${PROG}.elf ${PROG}
1211.33Sgmcgarry.endif
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