1 1.32.4.6 thorpej # $NetBSD: Makefile.booters,v 1.32.4.6 2002/12/11 06:11:35 thorpej 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.6 thorpej AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls 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.6 thorpej CFLAGS= -ffreestanding -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.5 nathanw NOMAN= # defined 38 1.32.4.5 nathanw 39 1.32.4.2 nathanw .if defined(PRIMARY_PROG) 40 1.32.4.2 nathanw PROG= ${PRIMARY_PROG} 41 1.32.4.2 nathanw SRCS = start.S bootxx.c callvec.c 42 1.32.4.2 nathanw SRCS+= devopen.c conf.c rz.c 43 1.32.4.2 nathanw SRCS+= bootinit.S bootread.S clear_cache.S printf.S 44 1.32.4.2 nathanw 45 1.32.4.2 nathanw LOAD_ADDRESS= ${PRIMARY_LOAD_ADDRESS} 46 1.32.4.2 nathanw # Pick a number, any number... 47 1.32.4.2 nathanw PRIMARY_MAX_TOTAL!= expr 16 \* 1024 48 1.32.4.2 nathanw 49 1.32.4.2 nathanw CPPFLAGS+= -DPRIMARY_BOOTBLOCK \ 50 1.32.4.2 nathanw -DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \ 51 1.32.4.2 nathanw -DNO_GETCHAR \ 52 1.32.4.2 nathanw -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \ 53 1.32.4.2 nathanw -DLIBSA_NO_FS_CLOSE \ 54 1.32.4.2 nathanw -DLIBSA_NO_DEV_CLOSE \ 55 1.32.4.2 nathanw -DLIBSA_SINGLE_DEVICE=rz \ 56 1.32.4.2 nathanw -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \ 57 1.32.4.2 nathanw -DLIBSA_NO_TWIDDLE \ 58 1.32.4.2 nathanw -DLIBSA_NO_FD_CHECKING \ 59 1.32.4.2 nathanw -DLIBSA_NO_RAW_ACCESS \ 60 1.32.4.2 nathanw -DLIBSA_NO_DISKLABEL_MSGS \ 61 1.32.4.2 nathanw -DALLOC_FIRST_FIT \ 62 1.32.4.2 nathanw -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET 63 1.32.4.2 nathanw 64 1.32.4.2 nathanw CHECKSIZE_CMD?= SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh 65 1.32.4.2 nathanw 66 1.32.4.2 nathanw .elif defined(SECONDARY_PROG) 67 1.32.4.2 nathanw PROG= ${SECONDARY_PROG} 68 1.32.4.2 nathanw LOAD_ADDRESS= ${SECONDARY_LOAD_ADDRESS} 69 1.32.4.2 nathanw CPPFLAGS+= -DSECONDARY_BOOTBLOCK 70 1.32.4.2 nathanw SRCS+= vers.c 71 1.32.4.2 nathanw CLEANFILES+= vers.c 72 1.32.4.2 nathanw .else 73 1.32.4.2 nathanw # XXX ? 74 1.32.4.2 nathanw .endif 75 1.32.4.2 nathanw 76 1.32.4.2 nathanw ### find out what to use for libkern 77 1.32.4.2 nathanw KERN_AS= library 78 1.32.4.2 nathanw .include "${S}/lib/libkern/Makefile.inc" 79 1.32.4.2 nathanw LIBKERN= ${KERNLIB} 80 1.32.4.2 nathanw 81 1.32.4.2 nathanw ### find out what to use for libz 82 1.32.4.2 nathanw .if defined(PRIMARY_PROG) 83 1.32.4.2 nathanw LIBZ= 84 1.32.4.2 nathanw .else 85 1.32.4.2 nathanw Z_AS= library 86 1.32.4.2 nathanw .include "${S}/lib/libz/Makefile.inc" 87 1.32.4.2 nathanw LIBZ= ${ZLIB} 88 1.32.4.2 nathanw .endif 89 1.32.4.2 nathanw 90 1.32.4.2 nathanw ### find out what to use for libsa 91 1.32.4.2 nathanw SA_AS= library 92 1.32.4.2 nathanw .if defined(PRIMARY_PROG) 93 1.32.4.2 nathanw SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no 94 1.32.4.2 nathanw .endif 95 1.32.4.2 nathanw .if defined(SECONDARY_PROG) 96 1.32.4.2 nathanw SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 97 1.32.4.2 nathanw SAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes 98 1.32.4.2 nathanw .endif 99 1.32.4.2 nathanw .include "${S}/lib/libsa/Makefile.inc" 100 1.32.4.2 nathanw LIBSA= ${SALIB} 101 1.32.4.2 nathanw 102 1.32.4.2 nathanw LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} 103 1.32.4.2 nathanw 104 1.32.4.5 nathanw .include <bsd.own.mk> 105 1.32.4.5 nathanw 106 1.32.4.2 nathanw .PHONY: vers.c 107 1.32.4.2 nathanw vers.c: ${.CURDIR}/version 108 1.32.4.2 nathanw sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "pmax" 109 1.32.4.2 nathanw 110 1.32.4.2 nathanw ${PROG}: machine mips pmax ${OBJS} ${LIBS} 111 1.32.4.2 nathanw ${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 112 1.32.4.2 nathanw ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS} 113 1.32.4.2 nathanw @${SIZE} ${PROG} 114 1.32.4.2 nathanw .if defined(CHECKSIZE_CMD) 115 1.32.4.2 nathanw @${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \ 116 1.32.4.2 nathanw (rm -f ${PROG} ; false) 117 1.32.4.2 nathanw .endif 118 1.32.4.2 nathanw .if defined(DO_ECOFF_BINARY) 119 1.32.4.2 nathanw @echo -n "Creating ECOFF binary... " 120 1.32.4.2 nathanw @mv ${PROG} ${PROG}.elf 121 1.32.4.3 nathanw @${ELF2ECOFF} ${PROG}.elf ${PROG} 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