Makefile.booters revision 1.41
11.41Ssimonb# $NetBSD: Makefile.booters,v 1.41 2003/10/08 01:40:23 simonb 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.41Ssimonb
211.41Ssimonb# XXX SHOULD NOT NEED TO DEFINE THESE!
221.41SsimonbLIBCRT0=
231.41SsimonbLIBC=
241.41SsimonbLIBCRTBEGIN=
251.41SsimonbLIBCRTEND=
261.34Sgmcgarry
271.27Ssimonb.PATH:		${.CURDIR}/../common
281.40SjdolecekAFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls
291.27Ssimonb# -I${.CURDIR}/../.. done by Makefile.inc
301.32SsimonbCPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES \
311.32Ssimonb		-I${.OBJDIR} -I${S}
321.27Ssimonb# compiler flags for smallest code size
331.39SjdolecekCFLAGS=		-ffreestanding -Os -g -mmemcpy -mno-abicalls -G 128
341.32SsimonbOFORMAT=	--oformat elf32-littlemips
351.32SsimonbLDBUG=		-T $S/arch/mips/conf/stand.ldscript
361.27Ssimonb
371.27SsimonbNETBSD_VERS!=	sh ${.CURDIR}/../../../../conf/osrelease.sh
381.27SsimonbCPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
391.27Ssimonb
401.27SsimonbPRIMARY_LOAD_ADDRESS?=	0x80700000
411.27SsimonbSECONDARY_LOAD_ADDRESS?=0x80710000
421.37Sjdolecek
431.38SsimonbNOMAN=		# defined
441.27Ssimonb
451.27Ssimonb.if defined(PRIMARY_PROG)
461.27SsimonbPROG=		${PRIMARY_PROG}
471.27SsimonbSRCS =		start.S bootxx.c callvec.c
481.27SsimonbSRCS+=		devopen.c conf.c rz.c
491.27SsimonbSRCS+=		bootinit.S bootread.S clear_cache.S printf.S
501.27Ssimonb
511.27SsimonbLOAD_ADDRESS=	${PRIMARY_LOAD_ADDRESS}
521.27Ssimonb# Pick a number, any number...
531.27SsimonbPRIMARY_MAX_TOTAL!=	expr 16 \* 1024
541.27Ssimonb
551.27SsimonbCPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
561.27Ssimonb		-DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \
571.27Ssimonb		-DNO_GETCHAR \
581.27Ssimonb		-DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \
591.27Ssimonb		-DLIBSA_NO_FS_CLOSE \
601.27Ssimonb		-DLIBSA_NO_DEV_CLOSE \
611.27Ssimonb		-DLIBSA_SINGLE_DEVICE=rz \
621.27Ssimonb		-D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \
631.27Ssimonb		-DLIBSA_NO_TWIDDLE \
641.27Ssimonb		-DLIBSA_NO_FD_CHECKING \
651.27Ssimonb		-DLIBSA_NO_RAW_ACCESS \
661.27Ssimonb		-DLIBSA_NO_DISKLABEL_MSGS \
671.27Ssimonb		-DALLOC_FIRST_FIT \
681.27Ssimonb		-DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET
691.27Ssimonb
701.27SsimonbCHECKSIZE_CMD?=	SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh
711.27Ssimonb
721.27Ssimonb.elif defined(SECONDARY_PROG)
731.27SsimonbPROG=		${SECONDARY_PROG}
741.27SsimonbLOAD_ADDRESS=	${SECONDARY_LOAD_ADDRESS}
751.27SsimonbCPPFLAGS+=	-DSECONDARY_BOOTBLOCK
761.30SjdolecekSRCS+=	vers.c
771.30SjdolecekCLEANFILES+= vers.c
781.27Ssimonb.else
791.27Ssimonb# XXX ?
801.27Ssimonb.endif
811.18Ssimonb
821.27Ssimonb### find out what to use for libkern
831.27SsimonbKERN_AS=	library
841.27Ssimonb.include "${S}/lib/libkern/Makefile.inc"
851.27SsimonbLIBKERN=	${KERNLIB}
861.18Ssimonb
871.18Ssimonb### find out what to use for libz
881.27Ssimonb.if defined(PRIMARY_PROG)
891.27SsimonbLIBZ=
901.27Ssimonb.else
911.18SsimonbZ_AS=		library
921.18Ssimonb.include "${S}/lib/libz/Makefile.inc"
931.18SsimonbLIBZ=		${ZLIB}
941.27Ssimonb.endif
951.18Ssimonb
961.27Ssimonb### find out what to use for libsa
971.27SsimonbSA_AS=		library
981.27Ssimonb.if defined(PRIMARY_PROG)
991.27SsimonbSAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
1001.27Ssimonb.endif
1011.27Ssimonb.if defined(SECONDARY_PROG)
1021.27SsimonbSAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
1031.33SgmcgarrySAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes
1041.22Ssimonb.endif
1051.27Ssimonb.include "${S}/lib/libsa/Makefile.inc"
1061.27SsimonbLIBSA=		${SALIB}
1071.18Ssimonb
1081.27SsimonbLIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
1091.36Sgmcgarry
1101.36Sgmcgarry.include <bsd.own.mk>
1111.18Ssimonb
1121.30Sjdolecek.PHONY: vers.c
1131.30Sjdolecekvers.c: ${.CURDIR}/version
1141.30Sjdolecek	sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "pmax"
1151.18Ssimonb
1161.30Sjdolecek${PROG}: machine mips pmax ${OBJS} ${LIBS}
1171.32Ssimonb	${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
1181.32Ssimonb	    ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS}
1191.27Ssimonb	@${SIZE} ${PROG}
1201.27Ssimonb.if defined(CHECKSIZE_CMD)
1211.27Ssimonb	@${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \
1221.27Ssimonb	    (rm -f ${PROG} ; false)
1231.33Sgmcgarry.endif
1241.33Sgmcgarry.if defined(DO_ECOFF_BINARY)
1251.33Sgmcgarry	@echo -n "Creating ECOFF binary... "
1261.33Sgmcgarry	@mv ${PROG} ${PROG}.elf
1271.34Sgmcgarry	@${ELF2ECOFF} ${PROG}.elf ${PROG}
1281.33Sgmcgarry	@echo done.
1291.27Ssimonb.endif
1301.18Ssimonb
1311.31Stsutsui.include <bsd.prog.mk>
1321.31Stsutsui
1331.27SsimonbCLEANFILES+=	${PROG}.map
1341.20Ssimonb
1351.20Ssimonbcleandir distclean: cleanlibdir
1361.20Ssimonb
1371.20Ssimonbcleanlibdir:
1381.20Ssimonb	rm -rf lib
139