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