Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.16
      1 #	$NetBSD: Makefile,v 1.16 2008/03/16 10:10:43 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 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 COMBASE?=0xbc800000
     48 COMSPEED?=115200
     49 COMPROBE?=0xa020001c
     50 
     51 ZSCHAN?=0x01		# 0x01: ZS_CHAN_A, 0x00: ZS_CHAN_B
     52 ZSBASE?=0xbc800000
     53 ZSSPEED?=115200
     54 ZSPROBE?=0xa020001c
     55 
     56 AFLAGS+=	-D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls
     57 
     58 # -I${.CURDIR}/../.. done by Makefile.inc
     59 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES
     60 # CPPFLAGS+=	-D_DEBUG
     61 CPPFLAGS+=	-I${.OBJDIR} -I${S} -I${S}/arch -I${LIBSADIR}
     62 CPPFLAGS+=	-DCONS_SERIAL -DCOMBASE=${COMBASE} -DCOMPORT=${COMPORT}
     63 CPPFLAGS+=	-DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE}
     64 CPPFLAGS+=	-DCONS_ZS -DZSBASE=${ZSBASE} -DZSCHAN=${ZSCHAN}
     65 CPPFLAGS+=	-DZSSPEED=${ZSSPEED} -DZSPROBE=${ZSPROBE}
     66 CPPFLAGS+=	-DSUPPORT_DHCP -DSUPPORT_BOOTP
     67 #CPPFLAGS+=	-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG
     68 #CPPFLAGS+=	-DRPC_DEBUG -DRARP_DEBUG -DNET_DEBUG -DDEBUG -DPARANOID
     69 
     70 # compiler flags for smallest code size
     71 CFLAGS=		-Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128
     72 
     73 CFLAGS+=	-Wall -Werror
     74 CFLAGS+=	-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
     75 CFLAGS+=	-Wno-pointer-sign
     76 
     77 NETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
     78 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     79 
     80 LDSCRIPT?=	${MIPS}/conf/stand.ldscript
     81 
     82 PROG=		boot
     83 # common sources
     84 SRCS+=		start.S boot.c devopen.c conf.c clock.c bootinfo.c
     85 SRCS+=		prf.c com.c cons.c ns16550.c pciide.c tgets.c wdc.c wd.c
     86 SRCS+=		zs.c
     87 SRCS+=		cache.c pci.c nif_tlp.c tlp.c
     88 
     89 # XXX dev_net.c should really be in libsa, but it doesn't
     90 #     declare ip_convertaddr correctly.
     91 .PATH: ${LIBSADIR}
     92 SRCS+=		dev_net.c
     93 
     94 SRCS+=		vers.c
     95 CLEANFILES+=	vers.c
     96 
     97 ### find out what to use for libkern
     98 KERN_AS=	library
     99 .include "${S}/lib/libkern/Makefile.inc"
    100 
    101 ### find out what to use for libz
    102 Z_AS=		library
    103 .include "${S}/lib/libz/Makefile.inc"
    104 
    105 ### find out what to use for libsa
    106 SA_AS=		library
    107 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
    108 .include "${S}/lib/libsa/Makefile.inc"
    109 
    110 LIBS=		${SALIB} ${ZLIB} ${KERNLIB}
    111 
    112 .PHONY: vers.c
    113 vers.c: ${.CURDIR}/version
    114 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt"
    115 
    116 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS}
    117 	${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
    118 	    -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS}
    119 	gzip -c9 ${PROG} > ${PROG}.gz
    120 	@${SIZE} ${PROG}
    121 
    122 CLEANFILES+=	${PROG}.map ${PROG}.elf ${PROG}.gz
    123 
    124 cleandir distclean: cleanlibdir
    125 
    126 cleanlibdir:
    127 	-rm -rf lib
    128 
    129 .include <bsd.prog.mk>
    130