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