1 1.41 simonb # $NetBSD: Makefile.booters,v 1.41 2003/10/08 01:40:23 simonb 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.41 simonb 21 1.41 simonb # XXX SHOULD NOT NEED TO DEFINE THESE! 22 1.41 simonb LIBCRT0= 23 1.41 simonb LIBC= 24 1.41 simonb LIBCRTBEGIN= 25 1.41 simonb LIBCRTEND= 26 1.34 gmcgarry 27 1.27 simonb .PATH: ${.CURDIR}/../common 28 1.40 jdolecek AFLAGS+= -D_LOCORE -D_KERNEL -mno-abicalls 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.39 jdolecek CFLAGS= -ffreestanding -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.37 jdolecek 43 1.38 simonb NOMAN= # defined 44 1.27 simonb 45 1.27 simonb .if defined(PRIMARY_PROG) 46 1.27 simonb PROG= ${PRIMARY_PROG} 47 1.27 simonb SRCS = start.S bootxx.c callvec.c 48 1.27 simonb SRCS+= devopen.c conf.c rz.c 49 1.27 simonb SRCS+= bootinit.S bootread.S clear_cache.S printf.S 50 1.27 simonb 51 1.27 simonb LOAD_ADDRESS= ${PRIMARY_LOAD_ADDRESS} 52 1.27 simonb # Pick a number, any number... 53 1.27 simonb PRIMARY_MAX_TOTAL!= expr 16 \* 1024 54 1.27 simonb 55 1.27 simonb CPPFLAGS+= -DPRIMARY_BOOTBLOCK \ 56 1.27 simonb -DPRIMARY_LOAD_ADDRESS="${PRIMARY_LOAD_ADDRESS}" \ 57 1.27 simonb -DNO_GETCHAR \ 58 1.27 simonb -DLIBSA_NO_FS_SYMLINK -DLIBSA_NO_FS_WRITE \ 59 1.27 simonb -DLIBSA_NO_FS_CLOSE \ 60 1.27 simonb -DLIBSA_NO_DEV_CLOSE \ 61 1.27 simonb -DLIBSA_SINGLE_DEVICE=rz \ 62 1.27 simonb -D"rzioctl(x,y,z)=EINVAL" -D"rzclose(f)=0" \ 63 1.27 simonb -DLIBSA_NO_TWIDDLE \ 64 1.27 simonb -DLIBSA_NO_FD_CHECKING \ 65 1.27 simonb -DLIBSA_NO_RAW_ACCESS \ 66 1.27 simonb -DLIBSA_NO_DISKLABEL_MSGS \ 67 1.27 simonb -DALLOC_FIRST_FIT \ 68 1.27 simonb -DLIBSA_USE_MEMCPY -DLIBSA_USE_MEMSET 69 1.27 simonb 70 1.27 simonb CHECKSIZE_CMD?= SIZE=${SIZE} sh ${.CURDIR}/../common/checksize.sh 71 1.27 simonb 72 1.27 simonb .elif defined(SECONDARY_PROG) 73 1.27 simonb PROG= ${SECONDARY_PROG} 74 1.27 simonb LOAD_ADDRESS= ${SECONDARY_LOAD_ADDRESS} 75 1.27 simonb CPPFLAGS+= -DSECONDARY_BOOTBLOCK 76 1.30 jdolecek SRCS+= vers.c 77 1.30 jdolecek CLEANFILES+= vers.c 78 1.27 simonb .else 79 1.27 simonb # XXX ? 80 1.27 simonb .endif 81 1.18 simonb 82 1.27 simonb ### find out what to use for libkern 83 1.27 simonb KERN_AS= library 84 1.27 simonb .include "${S}/lib/libkern/Makefile.inc" 85 1.27 simonb LIBKERN= ${KERNLIB} 86 1.18 simonb 87 1.18 simonb ### find out what to use for libz 88 1.27 simonb .if defined(PRIMARY_PROG) 89 1.27 simonb LIBZ= 90 1.27 simonb .else 91 1.18 simonb Z_AS= library 92 1.18 simonb .include "${S}/lib/libz/Makefile.inc" 93 1.18 simonb LIBZ= ${ZLIB} 94 1.27 simonb .endif 95 1.18 simonb 96 1.27 simonb ### find out what to use for libsa 97 1.27 simonb SA_AS= library 98 1.27 simonb .if defined(PRIMARY_PROG) 99 1.27 simonb SAMISCMAKEFLAGS+=SA_INCLUDE_NET=no 100 1.27 simonb .endif 101 1.27 simonb .if defined(SECONDARY_PROG) 102 1.27 simonb SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 103 1.33 gmcgarry SAMISCMAKEFLAGS+=SA_INCLUDE_NET=yes 104 1.22 simonb .endif 105 1.27 simonb .include "${S}/lib/libsa/Makefile.inc" 106 1.27 simonb LIBSA= ${SALIB} 107 1.18 simonb 108 1.27 simonb LIBS= ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} 109 1.36 gmcgarry 110 1.36 gmcgarry .include <bsd.own.mk> 111 1.18 simonb 112 1.30 jdolecek .PHONY: vers.c 113 1.30 jdolecek vers.c: ${.CURDIR}/version 114 1.30 jdolecek sh ${S}/conf/newvers_stand.sh -N ${.CURDIR}/version "pmax" 115 1.18 simonb 116 1.30 jdolecek ${PROG}: machine mips pmax ${OBJS} ${LIBS} 117 1.32 simonb ${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 118 1.32 simonb ${LDBUG} -e start -o ${PROG} ${OBJS} ${LIBS} 119 1.27 simonb @${SIZE} ${PROG} 120 1.27 simonb .if defined(CHECKSIZE_CMD) 121 1.27 simonb @${CHECKSIZE_CMD} ${PROG} ${PRIMARY_MAX_LOAD} ${PRIMARY_MAX_TOTAL} || \ 122 1.27 simonb (rm -f ${PROG} ; false) 123 1.33 gmcgarry .endif 124 1.33 gmcgarry .if defined(DO_ECOFF_BINARY) 125 1.33 gmcgarry @echo -n "Creating ECOFF binary... " 126 1.33 gmcgarry @mv ${PROG} ${PROG}.elf 127 1.34 gmcgarry @${ELF2ECOFF} ${PROG}.elf ${PROG} 128 1.33 gmcgarry @echo done. 129 1.27 simonb .endif 130 1.18 simonb 131 1.31 tsutsui .include <bsd.prog.mk> 132 1.31 tsutsui 133 1.27 simonb CLEANFILES+= ${PROG}.map 134 1.20 simonb 135 1.20 simonb cleandir distclean: cleanlibdir 136 1.20 simonb 137 1.20 simonb cleanlibdir: 138 1.20 simonb rm -rf lib 139