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