1 # $NetBSD: Makefile,v 1.12.16.1 2008/04/03 12:42:13 mjf 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 LIBSADIR= ${S}/lib/libsa 12 13 # .PATH: ${.CURDIR}/../common 14 15 BINMODE?= 444 16 17 # XXX SHOULD NOT NEED TO DEFINE THESE! 18 LIBCRT0= 19 LIBC= 20 LIBCRTBEGIN= 21 LIBCRTEND= 22 23 .PHONY: machine-links 24 beforedepend: machine-links 25 26 machine-links: machine cobalt mips 27 machine cobalt: 28 -rm -f ${.TARGET} 29 ln -s ${COBALT}/include ${.TARGET} 30 31 mips: 32 -rm -f ${.TARGET} 33 ln -s ${MIPS}/include ${.TARGET} 34 35 CLEANFILES+= machine cobalt mips 36 37 realall: machine-links ${PROG} 38 39 # Load @15Mb boundary as most (all?) of the Cobalt boxes 40 # had been shipped with at least 16Mb. 41 # 42 # XXX The proper fix is to load at the kernel base address 43 # and to relocate itself at the end of available memory. 44 LOAD_ADDRESS?=0x80F00000 45 46 COMPORT?=0x0 47 COMSPEED?=115200 48 COMPROBE?=0xa020001c 49 50 ZSCHAN?=0x01 # 0x01: ZS_CHAN_A, 0x00: ZS_CHAN_B 51 ZSSPEED?=115200 52 ZSPROBE?=0xa020001c 53 54 AFLAGS+= -D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls 55 56 # -I${.CURDIR}/../.. done by Makefile.inc 57 CPPFLAGS+= -nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES 58 # CPPFLAGS+= -D_DEBUG 59 CPPFLAGS+= -I${.OBJDIR} -I${S} -I${S}/arch -I${LIBSADIR} 60 CPPFLAGS+= -DCONS_SERIAL -DCOMPORT=${COMPORT} 61 CPPFLAGS+= -DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE} 62 CPPFLAGS+= -DCONS_ZS -DZSCHAN=${ZSCHAN} 63 CPPFLAGS+= -DZSSPEED=${ZSSPEED} -DZSPROBE=${ZSPROBE} 64 CPPFLAGS+= -DSUPPORT_DHCP -DSUPPORT_BOOTP 65 #CPPFLAGS+= -DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG 66 #CPPFLAGS+= -DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID 67 68 # compiler flags for smallest code size 69 CFLAGS= -Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128 70 71 CFLAGS+= -Wall -Werror 72 CFLAGS+= -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith 73 CFLAGS+= -Wno-pointer-sign 74 75 NETBSD_VERS!= ${HOST_SH} ${S}/conf/osrelease.sh 76 CPPFLAGS+= -DNETBSD_VERS='"${NETBSD_VERS}"' 77 78 LDSCRIPT?= ${MIPS}/conf/stand.ldscript 79 80 PROG= boot 81 # common sources 82 SRCS+= start.S boot.c devopen.c conf.c clock.c bootinfo.c 83 SRCS+= prf.c com.c cons.c ns16550.c pciide.c tgets.c wdc.c wd.c 84 SRCS+= zs.c 85 SRCS+= cache.c pci.c nif_tlp.c tlp.c 86 87 # XXX dev_net.c should really be in libsa, but it doesn't 88 # declare ip_convertaddr correctly. 89 .PATH: ${LIBSADIR} 90 SRCS+= dev_net.c 91 92 SRCS+= vers.c 93 CLEANFILES+= vers.c 94 95 ### find out what to use for libkern 96 KERN_AS= library 97 .include "${S}/lib/libkern/Makefile.inc" 98 99 ### find out what to use for libz 100 Z_AS= library 101 .include "${S}/lib/libz/Makefile.inc" 102 103 ### find out what to use for libsa 104 SA_AS= library 105 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes 106 .include "${S}/lib/libsa/Makefile.inc" 107 108 LIBS= ${SALIB} ${ZLIB} ${KERNLIB} 109 110 .PHONY: vers.c 111 vers.c: ${.CURDIR}/version 112 ${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt" 113 114 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS} 115 ${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \ 116 -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS} 117 gzip -c9 ${PROG} > ${PROG}.gz 118 @${SIZE} ${PROG} 119 120 CLEANFILES+= ${PROG}.map ${PROG}.elf ${PROG}.gz 121 122 cleandir distclean: cleanlibdir 123 124 cleanlibdir: 125 -rm -rf lib 126 127 .include <bsd.prog.mk> 128