NetBSD/sys/arch/pmax/stand/Makefile.booters

91 lines
2.1 KiB
Makefile

# $NetBSD: Makefile.booters,v 1.22 1999/04/11 04:24:41 simonb Exp $
#
# NOTE: $S must correspond to the top of the 'sys' tree
.BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/mips
${PROG} depend all: ${.OBJDIR}/machine ${.OBJDIR}/mips
CLEANFILES+= machine mips
${.OBJDIR}/machine:
-rm -f ${.TARGET}
ln -s $S/arch/${MACHINE}/include ${.TARGET}
${.OBJDIR}/mips:
-rm -f ${.TARGET}
ln -s $S/arch/mips/include mips
# Tailor C compilation for standalone environment.
COPTS= -Os # -Os gives smaller code
C_MACHDEP=-mmemcpy -mno-abicalls -G 128 # even smaller code
DEFS?= -D_STANDALONE -D_NO_PROM_DEFINES -DNO_ABICALLS \
${BOOTDEFADD}
INCL?= -nostdinc -I${.OBJDIR} -I$S -I${PMAX_STAND_DIR}/lib -I$S/lib/libsa
CFLAGS+= ${CWARN} ${C_MACHDEP}
AFLAGS+= -D_LOCORE -D_KERNEL
CPPFLAGS+= ${DEFS} ${INCL}
LDBUG= -T $S/arch/mips/conf/stand.ldscript
### find out what to use for libsa
SA_AS= library
.include "${S}/lib/libsa/Makefile.inc"
LIBSA= ${SALIB}
SAMISCMAKEFLAGS= SA_INCLUDE_NET=yes
# We don't need libkern/libz for the first stage bootblocks
.if ${PROG} != "bootxx"
### find out what to use for libz
Z_AS= library
.include "${S}/lib/libz/Makefile.inc"
LIBZ= ${ZLIB}
# and use compressed read in libsa
SAMISCMAKEFLAGS= SA_USE_CREAD=yes
### find out what to use for libkern
KERN_AS= library
.include "${S}/lib/libkern/Makefile.inc"
LIBKERN= ${KERNLIB}
.else # ${PROG} == "bootxx"
LIBZ=
.endif
PMAX_STAND_DIR?= $S/arch/pmax/stand
### find out what to use for libpmax
PMAXDIR= ${PMAX_STAND_DIR}/lib
.include "${PMAXDIR}/Makefile.inc"
LIBPMAX= ${PMAXLIB}
LIBS= ${LIBPMAX} ${LIBKERN} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBPMAX}
VERS_O?=vers.o
${PROG}: ${OBJS} ${LIBS}
.if ${VERS_O} != ""
sh ${PMAX_STAND_DIR}/lib/newvers.sh ${VERSIONFILE} ${NEWVERSWHAT}
${COMPILE.c} vers.c
.endif
ld -Map ${PROG}.map -N -x -Ttext ${RELOC} ${LDBUG} -e start \
${OBJS} ${VERS_O} ${LIBS} -o ${PROG}
CLEANFILES+=${PROG}.map
.if ${VERS_O} != ""
CLEANFILES+=vers.c vers.o
.endif
cleandir distclean: cleanlibdir
cleanlibdir:
rm -rf lib
.include <bsd.prog.mk>
# be sure to turn off any PIC flags for standalone library code.
CPICFLAGS=
CAPICFLAGS=
CPPPICFLAGS=
APICFLAGS=