Makefile.booters revision 1.22
11.22Ssimonb#	$NetBSD: Makefile.booters,v 1.22 1999/04/11 04:24:41 simonb Exp $
21.18Ssimonb#
31.18Ssimonb#	NOTE: $S must correspond to the top of the 'sys' tree
41.1Sderaadt
51.18Ssimonb.BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/mips
61.18Ssimonb${PROG} depend all: ${.OBJDIR}/machine ${.OBJDIR}/mips
71.18SsimonbCLEANFILES+= machine mips
81.5Smellon
91.18Ssimonb${.OBJDIR}/machine:
101.18Ssimonb	-rm -f ${.TARGET}
111.18Ssimonb	ln -s $S/arch/${MACHINE}/include ${.TARGET}
121.15Ssimonb
131.18Ssimonb${.OBJDIR}/mips:
141.18Ssimonb	-rm -f ${.TARGET}
151.18Ssimonb	ln -s $S/arch/mips/include mips
161.1Sderaadt
171.18Ssimonb# Tailor C compilation for standalone environment.
181.18SsimonbCOPTS=	-Os				# -Os gives smaller code
191.18Ssimonb
201.18SsimonbC_MACHDEP=-mmemcpy -mno-abicalls -G 128	# even smaller code
211.18Ssimonb
221.22SsimonbDEFS?=	-D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
231.18Ssimonb	${BOOTDEFADD}
241.18SsimonbINCL?=	-nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
251.18Ssimonb
261.18SsimonbCFLAGS+=	${CWARN} ${C_MACHDEP}
271.18SsimonbAFLAGS+=	-D_LOCORE -D_KERNEL
281.18SsimonbCPPFLAGS+=	${DEFS} ${INCL}
291.18Ssimonb
301.18SsimonbLDBUG=	-T $S/arch/mips/conf/stand.ldscript
311.18Ssimonb
321.18Ssimonb### find out what to use for libsa
331.18SsimonbSA_AS=		library
341.18Ssimonb.include "${S}/lib/libsa/Makefile.inc"
351.18SsimonbLIBSA=		${SALIB}
361.21SsimonbSAMISCMAKEFLAGS= SA_INCLUDE_NET=yes
371.21Ssimonb
381.21Ssimonb# We don't need libkern/libz for the first stage bootblocks
391.21Ssimonb.if ${PROG} != "bootxx"
401.18Ssimonb
411.18Ssimonb### find out what to use for libz
421.18SsimonbZ_AS=		library
431.18Ssimonb.include "${S}/lib/libz/Makefile.inc"
441.18SsimonbLIBZ=		${ZLIB}
451.21Ssimonb# and use compressed read in libsa
461.21SsimonbSAMISCMAKEFLAGS= SA_USE_CREAD=yes
471.18Ssimonb
481.18Ssimonb### find out what to use for libkern
491.18SsimonbKERN_AS=	library
501.18Ssimonb.include "${S}/lib/libkern/Makefile.inc"
511.18SsimonbLIBKERN=	${KERNLIB}
521.18Ssimonb
531.22Ssimonb.else	# ${PROG} == "bootxx"
541.22SsimonbLIBZ=
551.22Ssimonb.endif
561.18Ssimonb
571.18SsimonbPMAX_STAND_DIR?= $S/arch/pmax/stand
581.18Ssimonb### find out what to use for libpmax
591.18SsimonbPMAXDIR= ${PMAX_STAND_DIR}/lib
601.18Ssimonb.include "${PMAXDIR}/Makefile.inc"
611.18SsimonbLIBPMAX=		${PMAXLIB}
621.18Ssimonb
631.19SsimonbLIBS=	${LIBPMAX} ${LIBKERN} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}
641.18SsimonbVERS_O?=vers.o
651.18Ssimonb
661.20Ssimonb${PROG}: ${OBJS} ${LIBS}
671.20Ssimonb.if ${VERS_O} != ""
681.20Ssimonb	sh ${PMAX_STAND_DIR}/lib/newvers.sh ${VERSIONFILE} ${NEWVERSWHAT}
691.18Ssimonb	${COMPILE.c} vers.c
701.20Ssimonb.endif
711.18Ssimonb	ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
721.18Ssimonb	    ${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
731.18Ssimonb
741.20SsimonbCLEANFILES+=${PROG}.map
751.20Ssimonb.if ${VERS_O} != ""
761.20SsimonbCLEANFILES+=vers.c vers.o
771.20Ssimonb.endif
781.20Ssimonb
791.20Ssimonbcleandir distclean: cleanlibdir
801.20Ssimonb
811.20Ssimonbcleanlibdir:
821.20Ssimonb	rm -rf lib
831.18Ssimonb
841.18Ssimonb.include <bsd.prog.mk>
851.18Ssimonb
861.18Ssimonb# be sure to turn off any PIC flags for standalone library code.
871.18SsimonbCPICFLAGS=
881.18SsimonbCAPICFLAGS=
891.18SsimonbCPPPICFLAGS=
901.18SsimonbAPICFLAGS=
91