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