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