1 # $NetBSD: Makefile,v 1.9 2005/01/01 07:00:50 simonb 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 # Load @15Mb boundary as most (all?) of the Cobalt boxes 39 # had been shipped with at least 16Mb. 40 # 41 # XXX The proper fix is to load at the kernel base address 42 # and to relocate itself at the end of available memory. 43 LOAD_ADDRESS?=0x80F00000 44 45 COMPORT?=0x0 46 COMBASE?=0xbc800000 47 COMSPEED?=115200 48 COMPROBE?=0xa020001c 49 50 AFLAGS+= -D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls 51 52 # -I${.CURDIR}/../.. done by Makefile.inc 53 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES 54 # CPPFLAGS+= -D_DEBUG 55 CPPFLAGS+= -I${.OBJDIR} -I${S} -I${S}/lib/libsa 56 CPPFLAGS+= -DCONS_SERIAL -DCOMBASE=${COMBASE} -DCOMPORT=${COMPORT} 57 CPPFLAGS+= -DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE} 58 59 # compiler flags for smallest code size 60 CFLAGS= -Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128 61 62 NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh 63 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 64 65 LDSCRIPT?= ${MIPS}/conf/stand.ldscript 66 67 PROG= boot 68 # common sources 69 SRCS+= start.S boot.c devopen.c conf.c clock.c bootinfo.c 70 SRCS+= prf.c com.c cons.c ns16550.c pciide.c tgets.c wdc.c wd.c 71 72 SRCS+= vers.c 73 CLEANFILES+= vers.c 74 75 ### find out what to use for libkern 76 KERN_AS= library 77 .include "${S}/lib/libkern/Makefile.inc" 78 79 ### find out what to use for libz 80 Z_AS= library 81 .include "${S}/lib/libz/Makefile.inc" 82 83 ### find out what to use for libsa 84 SA_AS= library 85 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 86 .include "${S}/lib/libsa/Makefile.inc" 87 88 LIBS= ${KERNLIB} ${SALIB} ${ZLIB} 89 90 .PHONY: vers.c 91 vers.c: ${.CURDIR}/version 92 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt" 93 94 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS} 95 ${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 96 -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS} 97 gzip -c9 ${PROG} > ${PROG}.gz 98 @${SIZE} ${PROG} 99 100 CLEANFILES+= ${PROG}.map ${PROG}.elf ${PROG}.gz 101 102 cleandir distclean: cleanlibdir 103 104 cleanlibdir: 105 -rm -rf lib 106 107 .include <bsd.prog.mk> 108