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