1 # $NetBSD: Makefile,v 1.4 2003/12/14 11:58:38 tsutsui Exp $ 2 3 NOMAN= # defined 4 5 .include <bsd.own.mk> 6 .include <bsd.sys.mk> # for HOST_SH 7 8 S= ${.CURDIR}/../../../.. 9 MIPS= ${S}/arch/mips 10 COBALT= ${S}/arch/cobalt 11 12 # .PATH: ${.CURDIR}/../common 13 14 BINMODE?= 444 15 16 # XXX SHOULD NOT NEED TO DEFINE THESE! 17 LIBCRT0= 18 LIBC= 19 LIBCRTBEGIN= 20 LIBCRTEND= 21 22 .PHONY: machine-links 23 beforedepend: machine-links 24 25 machine-links: machine cobalt mips 26 machine cobalt: 27 -rm -f ${.TARGET} 28 ln -s ${COBALT}/include ${.TARGET} 29 30 mips: 31 -rm -f ${.TARGET} 32 ln -s ${MIPS}/include ${.TARGET} 33 34 CLEANFILES+= machine cobalt mips 35 36 realall: machine-links ${PROG} 37 38 # PRIMARY_LOAD_ADDRESS?= 0x80600000 39 LOAD_ADDRESS?=0x81000000 40 41 COMPORT?=0x0 42 COMBASE?=0xbc800000 43 COMSPEED?=115200 44 COMPROBE?=0xa020001c 45 46 AFLAGS+= -D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls 47 48 # -I${.CURDIR}/../.. done by Makefile.inc 49 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES 50 # CPPFLAGS+= -D_DEBUG 51 CPPFLAGS+= -I${.OBJDIR} -I${S} -I${S}/lib/libsa 52 CPPFLAGS+= -DCONS_SERIAL -DCOMBASE=${COMBASE} -DCOMPORT=${COMPORT} 53 CPPFLAGS+= -DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE} 54 55 # compiler flags for smallest code size 56 CFLAGS= -Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128 57 OFORMAT= --oformat elf32-littlemips 58 59 NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh 60 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 61 62 LDSCRIPT?= ${MIPS}/conf/stand.ldscript 63 64 PROG= boot 65 # common sources 66 SRCS+= start.S boot.c devopen.c conf.c clock.c 67 SRCS+= prf.c com.c cons.c ns16550.c pciide.c wdc.c wd.c 68 69 SRCS+= vers.c 70 CLEANFILES+= vers.c 71 72 ### find out what to use for libkern 73 KERN_AS= library 74 .include "${S}/lib/libkern/Makefile.inc" 75 76 ### find out what to use for libz 77 Z_AS= library 78 .include "${S}/lib/libz/Makefile.inc" 79 80 ### find out what to use for libsa 81 SA_AS= library 82 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 83 .include "${S}/lib/libsa/Makefile.inc" 84 85 LIBS= ${KERNLIB} ${SALIB} ${ZLIB} 86 87 .PHONY: vers.c 88 vers.c: ${.CURDIR}/version 89 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt" 90 91 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS} 92 ${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 93 -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS} 94 gzip -c9 ${PROG} > ${PROG}.gz 95 @${SIZE} ${PROG} 96 97 CLEANFILES+= ${PROG}.map ${PROG}.elf ${PROG}.gz 98 99 cleandir distclean: cleanlibdir 100 101 cleanlibdir: 102 rm -rf lib 103 104 .include <bsd.prog.mk> 105