Makefile.booters revision 1.20
11.20Ssimonb#	$NetBSD: Makefile.booters,v 1.20 1999/03/31 03:10:56 simonb Exp $
21.18Ssimonb#
31.18Ssimonb#	NOTE: $S must correspond to the top of the 'sys' tree
41.1Sderaadt
51.18SsimonbBINDIR?=/usr/mdec
61.18SsimonbBINMODE?=444
71.1Sderaadt
81.18Ssimonb.BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/mips
91.18Ssimonb${PROG} depend all: ${.OBJDIR}/machine ${.OBJDIR}/mips
101.18SsimonbCLEANFILES+= machine mips
111.5Smellon
121.18Ssimonb${.OBJDIR}/machine:
131.18Ssimonb	-rm -f ${.TARGET}
141.18Ssimonb	ln -s $S/arch/${MACHINE}/include ${.TARGET}
151.15Ssimonb
161.18Ssimonb${.OBJDIR}/mips:
171.18Ssimonb	-rm -f ${.TARGET}
181.18Ssimonb	ln -s $S/arch/mips/include mips
191.1Sderaadt
201.18Ssimonb# Tailor C compilation for standalone environment.
211.18SsimonbCOPTS=	-Os				# -Os gives smaller code
221.18Ssimonb
231.18SsimonbC_MACHDEP=-mmemcpy -mno-abicalls -G 128	# even smaller code
241.18Ssimonb
251.18SsimonbDEFS?=	-DSMALL -D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
261.18Ssimonb	${BOOTDEFADD}
271.18SsimonbINCL?=	-nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
281.18Ssimonb
291.18SsimonbCFLAGS+=	${CWARN} ${C_MACHDEP}
301.18SsimonbAFLAGS+=	-D_LOCORE -D_KERNEL
311.18SsimonbCPPFLAGS+=	${DEFS} ${INCL}
321.18Ssimonb
331.18SsimonbLDBUG=	-T $S/arch/mips/conf/stand.ldscript
341.18Ssimonb
351.18Ssimonb# We don't need libkern/libsa for the first stage bootblocks
361.18Ssimonb.if ${PROG} != "bootxx"
371.18Ssimonb
381.18Ssimonb### find out what to use for libsa
391.18SsimonbSA_AS=		library
401.18Ssimonb.include "${S}/lib/libsa/Makefile.inc"
411.18SsimonbLIBSA=		${SALIB}
421.18SsimonbSAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no
431.18Ssimonb
441.18Ssimonb### find out what to use for libz
451.18SsimonbZ_AS=		library
461.18Ssimonb.include "${S}/lib/libz/Makefile.inc"
471.18SsimonbLIBZ=		${ZLIB}
481.18Ssimonb
491.18Ssimonb### find out what to use for libkern
501.18SsimonbKERN_AS=	library
511.18Ssimonb.include "${S}/lib/libkern/Makefile.inc"
521.18SsimonbLIBKERN=	${KERNLIB}
531.18Ssimonb
541.18Ssimonb.endif	# ${PROG} != "bootxx"
551.18Ssimonb
561.18SsimonbPMAX_STAND_DIR?= $S/arch/pmax/stand
571.18Ssimonb### find out what to use for libpmax
581.18SsimonbPMAXDIR= ${PMAX_STAND_DIR}/lib
591.18Ssimonb.include "${PMAXDIR}/Makefile.inc"
601.18SsimonbLIBPMAX=		${PMAXLIB}
611.18Ssimonb
621.19SsimonbLIBS=	${LIBPMAX} ${LIBKERN} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}
631.18SsimonbVERS_O?=vers.o
641.18Ssimonb
651.20Ssimonb${PROG}: ${OBJS} ${LIBS}
661.20Ssimonb.if ${VERS_O} != ""
671.20Ssimonb	sh ${PMAX_STAND_DIR}/lib/newvers.sh ${VERSIONFILE} ${NEWVERSWHAT}
681.18Ssimonb	${COMPILE.c} vers.c
691.20Ssimonb.endif
701.18Ssimonb	ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
711.18Ssimonb	    ${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
721.18Ssimonb
731.20SsimonbCLEANFILES+=${PROG}.map
741.20Ssimonb.if ${VERS_O} != ""
751.20SsimonbCLEANFILES+=vers.c vers.o
761.20Ssimonb.endif
771.20Ssimonb
781.20Ssimonbcleandir distclean: cleanlibdir
791.20Ssimonb
801.20Ssimonbcleanlibdir:
811.20Ssimonb	rm -rf lib
821.18Ssimonb
831.18Ssimonb.include <bsd.prog.mk>
841.18Ssimonb
851.18Ssimonb# be sure to turn off any PIC flags for standalone library code.
861.18SsimonbCPICFLAGS=
871.18SsimonbCAPICFLAGS=
881.18SsimonbCPPPICFLAGS=
891.18SsimonbAPICFLAGS=
90