Home | History | Annotate | Line # | Download | only in stand
Makefile.booters revision 1.22
      1  1.22   simonb #	$NetBSD: Makefile.booters,v 1.22 1999/04/11 04:24:41 simonb Exp $
      2  1.18   simonb #
      3  1.18   simonb #	NOTE: $S must correspond to the top of the 'sys' tree
      4   1.1  deraadt 
      5  1.18   simonb .BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/mips
      6  1.18   simonb ${PROG} depend all: ${.OBJDIR}/machine ${.OBJDIR}/mips
      7  1.18   simonb CLEANFILES+= machine mips
      8   1.5   mellon 
      9  1.18   simonb ${.OBJDIR}/machine:
     10  1.18   simonb 	-rm -f ${.TARGET}
     11  1.18   simonb 	ln -s $S/arch/${MACHINE}/include ${.TARGET}
     12  1.15   simonb 
     13  1.18   simonb ${.OBJDIR}/mips:
     14  1.18   simonb 	-rm -f ${.TARGET}
     15  1.18   simonb 	ln -s $S/arch/mips/include mips
     16   1.1  deraadt 
     17  1.18   simonb # Tailor C compilation for standalone environment.
     18  1.18   simonb COPTS=	-Os				# -Os gives smaller code
     19  1.18   simonb 
     20  1.18   simonb C_MACHDEP=-mmemcpy -mno-abicalls -G 128	# even smaller code
     21  1.18   simonb 
     22  1.22   simonb DEFS?=	-D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
     23  1.18   simonb 	${BOOTDEFADD}
     24  1.18   simonb INCL?=	-nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
     25  1.18   simonb 
     26  1.18   simonb CFLAGS+=	${CWARN} ${C_MACHDEP}
     27  1.18   simonb AFLAGS+=	-D_LOCORE -D_KERNEL
     28  1.18   simonb CPPFLAGS+=	${DEFS} ${INCL}
     29  1.18   simonb 
     30  1.18   simonb LDBUG=	-T $S/arch/mips/conf/stand.ldscript
     31  1.18   simonb 
     32  1.18   simonb ### find out what to use for libsa
     33  1.18   simonb SA_AS=		library
     34  1.18   simonb .include "${S}/lib/libsa/Makefile.inc"
     35  1.18   simonb LIBSA=		${SALIB}
     36  1.21   simonb SAMISCMAKEFLAGS= SA_INCLUDE_NET=yes
     37  1.21   simonb 
     38  1.21   simonb # We don't need libkern/libz for the first stage bootblocks
     39  1.21   simonb .if ${PROG} != "bootxx"
     40  1.18   simonb 
     41  1.18   simonb ### find out what to use for libz
     42  1.18   simonb Z_AS=		library
     43  1.18   simonb .include "${S}/lib/libz/Makefile.inc"
     44  1.18   simonb LIBZ=		${ZLIB}
     45  1.21   simonb # and use compressed read in libsa
     46  1.21   simonb SAMISCMAKEFLAGS= SA_USE_CREAD=yes
     47  1.18   simonb 
     48  1.18   simonb ### find out what to use for libkern
     49  1.18   simonb KERN_AS=	library
     50  1.18   simonb .include "${S}/lib/libkern/Makefile.inc"
     51  1.18   simonb LIBKERN=	${KERNLIB}
     52  1.18   simonb 
     53  1.22   simonb .else	# ${PROG} == "bootxx"
     54  1.22   simonb LIBZ=
     55  1.22   simonb .endif
     56  1.18   simonb 
     57  1.18   simonb PMAX_STAND_DIR?= $S/arch/pmax/stand
     58  1.18   simonb ### find out what to use for libpmax
     59  1.18   simonb PMAXDIR= ${PMAX_STAND_DIR}/lib
     60  1.18   simonb .include "${PMAXDIR}/Makefile.inc"
     61  1.18   simonb LIBPMAX=		${PMAXLIB}
     62  1.18   simonb 
     63  1.19   simonb LIBS=	${LIBPMAX} ${LIBKERN} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}
     64  1.18   simonb VERS_O?=vers.o
     65  1.18   simonb 
     66  1.20   simonb ${PROG}: ${OBJS} ${LIBS}
     67  1.20   simonb .if ${VERS_O} != ""
     68  1.20   simonb 	sh ${PMAX_STAND_DIR}/lib/newvers.sh ${VERSIONFILE} ${NEWVERSWHAT}
     69  1.18   simonb 	${COMPILE.c} vers.c
     70  1.20   simonb .endif
     71  1.18   simonb 	ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
     72  1.18   simonb 	    ${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
     73  1.18   simonb 
     74  1.20   simonb CLEANFILES+=${PROG}.map
     75  1.20   simonb .if ${VERS_O} != ""
     76  1.20   simonb CLEANFILES+=vers.c vers.o
     77  1.20   simonb .endif
     78  1.20   simonb 
     79  1.20   simonb cleandir distclean: cleanlibdir
     80  1.20   simonb 
     81  1.20   simonb cleanlibdir:
     82  1.20   simonb 	rm -rf lib
     83  1.18   simonb 
     84  1.18   simonb .include <bsd.prog.mk>
     85  1.18   simonb 
     86  1.18   simonb # be sure to turn off any PIC flags for standalone library code.
     87  1.18   simonb CPICFLAGS=
     88  1.18   simonb CAPICFLAGS=
     89  1.18   simonb CPPPICFLAGS=
     90  1.18   simonb APICFLAGS=
     91