1 1.25 simonb # $NetBSD: Makefile.booters,v 1.25 1999/11/12 01:37:42 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.24 mrg SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_INCLUDE_NET=yes 35 1.18 simonb .include "${S}/lib/libsa/Makefile.inc" 36 1.18 simonb LIBSA= ${SALIB} 37 1.21 simonb 38 1.25 simonb # We don't need 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.24 mrg SAMISCMAKEFLAGS+=SA_USE_CREAD=yes 47 1.18 simonb 48 1.22 simonb .else # ${PROG} == "bootxx" 49 1.22 simonb LIBZ= 50 1.22 simonb .endif 51 1.18 simonb 52 1.18 simonb PMAX_STAND_DIR?= $S/arch/pmax/stand 53 1.18 simonb ### find out what to use for libpmax 54 1.18 simonb PMAXDIR= ${PMAX_STAND_DIR}/lib 55 1.18 simonb .include "${PMAXDIR}/Makefile.inc" 56 1.18 simonb LIBPMAX= ${PMAXLIB} 57 1.18 simonb 58 1.25 simonb LIBS= ${LIBPMAX} ${LIBSA} ${LIBZ} ${LIBPMAX} 59 1.18 simonb VERS_O?=vers.o 60 1.18 simonb 61 1.20 simonb ${PROG}: ${OBJS} ${LIBS} 62 1.20 simonb .if ${VERS_O} != "" 63 1.20 simonb sh ${PMAX_STAND_DIR}/lib/newvers.sh ${VERSIONFILE} ${NEWVERSWHAT} 64 1.18 simonb ${COMPILE.c} vers.c 65 1.20 simonb .endif 66 1.18 simonb ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \ 67 1.18 simonb ${OBJS} ${VERS_O} ${LIBS} -o ${PROG} 68 1.18 simonb 69 1.20 simonb CLEANFILES+=${PROG}.map 70 1.20 simonb .if ${VERS_O} != "" 71 1.20 simonb CLEANFILES+=vers.c vers.o 72 1.20 simonb .endif 73 1.20 simonb 74 1.20 simonb cleandir distclean: cleanlibdir 75 1.20 simonb 76 1.20 simonb cleanlibdir: 77 1.20 simonb rm -rf lib 78 1.18 simonb 79 1.18 simonb .include <bsd.prog.mk> 80 1.18 simonb 81 1.18 simonb # be sure to turn off any PIC flags for standalone library code. 82 1.18 simonb CPICFLAGS= 83 1.18 simonb CAPICFLAGS= 84 1.18 simonb CPPPICFLAGS= 85 1.18 simonb APICFLAGS= 86