Home | History | Annotate | Line # | Download | only in stand
Makefile.booters revision 1.27
      1  1.27   simonb # $NetBSD: Makefile.booters,v 1.27 1999/11/27 23:55:23 simonb Exp $
      2   1.5   mellon 
      3  1.27   simonb # $S must correspond to the top of the 'sys' tree
      4  1.27   simonb S=	${.CURDIR}/../../../..
      5  1.27   simonb 
      6  1.27   simonb .BEGIN: ${.OBJDIR}/machine ${.OBJDIR}/pmax ${.OBJDIR}/mips
      7  1.27   simonb ${PROG} depend beforedepend all: ${.OBJDIR}/machine ${.OBJDIR}/pmax ${.OBJDIR}/mips
      8  1.27   simonb CLEANFILES+= machine pmax mips
      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.27   simonb ${.OBJDIR}/pmax:
     13  1.27   simonb 	-rm -f ${.TARGET}
     14  1.27   simonb 	ln -s $S/arch/${MACHINE}/include ${.TARGET}
     15  1.18   simonb ${.OBJDIR}/mips:
     16  1.18   simonb 	-rm -f ${.TARGET}
     17  1.18   simonb 	ln -s $S/arch/mips/include mips
     18   1.1  deraadt 
     19  1.27   simonb BINMODE?=	444
     20  1.18   simonb 
     21  1.27   simonb .PATH:		${.CURDIR}/../common
     22  1.18   simonb AFLAGS+=	-D_LOCORE -D_KERNEL
     23  1.27   simonb # -I${.CURDIR}/../.. done by Makefile.inc
     24  1.27   simonb CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES -I${.OBJDIR} -I${S}
     25  1.27   simonb # compiler flags for smallest code size
     26  1.27   simonb CFLAGS=		-Os -g -mmemcpy -mno-abicalls -G 128
     27  1.27   simonb LDBUG=		-T $S/arch/mips/conf/stand.ldscript
     28  1.27   simonb 
     29  1.27   simonb NETBSD_VERS!=	sh ${.CURDIR}/../../../../conf/osrelease.sh
     30  1.27   simonb CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     31  1.27   simonb 
     32  1.27   simonb PRIMARY_LOAD_ADDRESS?=	0x80700000
     33  1.27   simonb SECONDARY_LOAD_ADDRESS?=0x80710000
     34  1.27   simonb 
     35  1.27   simonb .if defined(PRIMARY_PROG)
     36  1.27   simonb PROG=		${PRIMARY_PROG}
     37  1.27   simonb SRCS =		start.S bootxx.c callvec.c
     38  1.27   simonb SRCS+=		devopen.c conf.c rz.c
     39  1.27   simonb SRCS+=		bootinit.S bootread.S clear_cache.S printf.S
     40  1.27   simonb 
     41  1.27   simonb LOAD_ADDRESS=	${PRIMARY_LOAD_ADDRESS}
     42  1.27   simonb # Pick a number, any number...
     43  1.27   simonb PRIMARY_MAX_TOTAL!=	expr 16 \* 1024
     44  1.27   simonb 
     45  1.27   simonb CPPFLAGS+=	-DPRIMARY_BOOTBLOCK \
     46  1.27   simonb 		-DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \
     47  1.27   simonb 		-DNO_GETCHAR \
     48  1.27   simonb 		-DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \
     49  1.27   simonb 		-DLIBSA_NO_FS_CLOSE \
     50  1.27   simonb 		-DLIBSA_NO_DEV_CLOSE \
     51  1.27   simonb 		-DLIBSA_SINGLE_DEVICE=rz \
     52  1.27   simonb 		-D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \
     53  1.27   simonb 		-DLIBSA_NO_TWIDDLE \
     54  1.27   simonb 		-DLIBSA_NO_FD_CHECKING \
     55  1.27   simonb 		-DLIBSA_NO_RAW_ACCESS \
     56  1.27   simonb 		-DLIBSA_NO_DISKLABEL_MSGS \
     57  1.27   simonb 		-DALLOC_FIRST_FIT \
     58  1.27   simonb 		-DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET
     59  1.27   simonb 
     60  1.27   simonb CHECKSIZE_CMD?=	SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh
     61  1.27   simonb 
     62  1.27   simonb .elif defined(SECONDARY_PROG)
     63  1.27   simonb PROG=		${SECONDARY_PROG}
     64  1.27   simonb LOAD_ADDRESS=	${SECONDARY_LOAD_ADDRESS}
     65  1.27   simonb CPPFLAGS+=	-DSECONDARY_BOOTBLOCK
     66  1.27   simonb VERS_O?=	vers.o
     67  1.27   simonb .else
     68  1.27   simonb # XXX ?
     69  1.27   simonb .endif
     70  1.18   simonb 
     71  1.27   simonb ### find out what to use for libkern
     72  1.27   simonb KERN_AS=	library
     73  1.27   simonb .include "${S}/lib/libkern/Makefile.inc"
     74  1.27   simonb LIBKERN=	${KERNLIB}
     75  1.18   simonb 
     76  1.18   simonb ### find out what to use for libz
     77  1.27   simonb .if defined(PRIMARY_PROG)
     78  1.27   simonb LIBZ=
     79  1.27   simonb .else
     80  1.18   simonb Z_AS=		library
     81  1.18   simonb .include "${S}/lib/libz/Makefile.inc"
     82  1.18   simonb LIBZ=		${ZLIB}
     83  1.27   simonb .endif
     84  1.18   simonb 
     85  1.27   simonb ### find out what to use for libsa
     86  1.27   simonb SA_AS=		library
     87  1.27   simonb .if defined(PRIMARY_PROG)
     88  1.27   simonb SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
     89  1.27   simonb .endif
     90  1.27   simonb .if defined(SECONDARY_PROG)
     91  1.27   simonb SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
     92  1.27   simonb # for now:
     93  1.27   simonb SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no
     94  1.22   simonb .endif
     95  1.27   simonb .include "${S}/lib/libsa/Makefile.inc"
     96  1.27   simonb LIBSA=		${SALIB}
     97  1.18   simonb 
     98  1.27   simonb LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
     99  1.18   simonb 
    100  1.18   simonb 
    101  1.20   simonb ${PROG}: ${OBJS} ${LIBS}
    102  1.27   simonb .if defined(VERS_O)
    103  1.27   simonb 	sh ${.CURDIR}/../common/newvers.sh ${.CURDIR}/version
    104  1.18   simonb 	${COMPILE.c} vers.c
    105  1.20   simonb .endif
    106  1.27   simonb 	${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} ${LDBUG} \
    107  1.27   simonb 	    -e start -o ${PROG} ${OBJS} ${VERS_O} ${LIBS}
    108  1.27   simonb 	@${SIZE} ${PROG}
    109  1.27   simonb .if defined(CHECKSIZE_CMD)
    110  1.27   simonb 	@${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \
    111  1.27   simonb 	    (rm -f ${PROG} ; false)
    112  1.27   simonb .endif
    113  1.18   simonb 
    114  1.27   simonb CLEANFILES+=	${PROG}.map
    115  1.27   simonb .if defined(VERS_O)
    116  1.20   simonb CLEANFILES+=vers.c vers.o
    117  1.20   simonb .endif
    118  1.20   simonb 
    119  1.20   simonb cleandir distclean: cleanlibdir
    120  1.20   simonb 
    121  1.20   simonb cleanlibdir:
    122  1.20   simonb 	rm -rf lib
    123  1.18   simonb 
    124  1.18   simonb .include <bsd.prog.mk>
    125