Makefile.booters revision 1.18
11.18Ssimonb#	$NetBSD: Makefile.booters,v 1.18 1999/03/27 07:17:50 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.18SsimonbCLEANFILES+=vers.c vers.o ${PROG}.map
211.5Smellon
221.18Ssimonb# Tailor C compilation for standalone environment.
231.18SsimonbCOPTS=	-Os				# -Os gives smaller code
241.18Ssimonb
251.18SsimonbC_MACHDEP=-mmemcpy -mno-abicalls -G 128	# even smaller code
261.18Ssimonb
271.18SsimonbDEFS?=	-DSMALL -D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
281.18Ssimonb	${BOOTDEFADD}
291.18SsimonbINCL?=	-nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
301.18Ssimonb
311.18SsimonbCFLAGS+=	${CWARN} ${C_MACHDEP}
321.18SsimonbAFLAGS+=	-D_LOCORE -D_KERNEL
331.18SsimonbCPPFLAGS+=	${DEFS} ${INCL}
341.18Ssimonb
351.18SsimonbLDBUG=	-T $S/arch/mips/conf/stand.ldscript
361.18Ssimonb
371.18Ssimonb# We don't need libkern/libsa for the first stage bootblocks
381.18Ssimonb.if ${PROG} != "bootxx"
391.18Ssimonb
401.18Ssimonb### find out what to use for libsa
411.18SsimonbSA_AS=		library
421.18Ssimonb.include "${S}/lib/libsa/Makefile.inc"
431.18SsimonbLIBSA=		${SALIB}
441.18SsimonbSAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no
451.18Ssimonb
461.18Ssimonb### find out what to use for libz
471.18SsimonbZ_AS=		library
481.18Ssimonb.include "${S}/lib/libz/Makefile.inc"
491.18SsimonbLIBZ=		${ZLIB}
501.18Ssimonb
511.18Ssimonb### find out what to use for libkern
521.18SsimonbKERN_AS=	library
531.18Ssimonb.include "${S}/lib/libkern/Makefile.inc"
541.18SsimonbLIBKERN=	${KERNLIB}
551.18Ssimonb
561.18Ssimonb.endif	# ${PROG} != "bootxx"
571.18Ssimonb
581.18SsimonbPMAX_STAND_DIR?= $S/arch/pmax/stand
591.18Ssimonb### find out what to use for libpmax
601.18SsimonbPMAXDIR= ${PMAX_STAND_DIR}/lib
611.18Ssimonb.include "${PMAXDIR}/Makefile.inc"
621.18SsimonbLIBPMAX=		${PMAXLIB}
631.18Ssimonb
641.18Ssimonbcleandir distclean: cleanlibdir
651.18Ssimonb
661.18Ssimonbcleanlibdir:
671.18Ssimonb	rm -rf lib
681.18Ssimonb
691.18SsimonbLIBS=	${LIBPMAX} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBPMAX}
701.18SsimonbVERS_O?=vers.o
711.18Ssimonb
721.18Ssimonbvers.o:	${VERSIONFILE}
731.18Ssimonb	sh ${PMAX_STAND_DIR}/lib/newvers.sh ${.ALLSRC} ${NEWVERSWHAT}
741.18Ssimonb	${COMPILE.c} vers.c
751.18Ssimonb
761.18Ssimonb${PROG}: ${OBJS} ${VERS_O} ${LIBS}
771.18Ssimonb	ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
781.18Ssimonb	    ${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
791.18Ssimonb
801.18Ssimonb
811.18Ssimonb.include <bsd.prog.mk>
821.18Ssimonb
831.18Ssimonb# be sure to turn off any PIC flags for standalone library code.
841.18SsimonbCPICFLAGS=
851.18SsimonbCAPICFLAGS=
861.18SsimonbCPPPICFLAGS=
871.18SsimonbAPICFLAGS=
88