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