Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.18
      1 #	$NetBSD: Makefile,v 1.18 2008/05/28 14:04:07 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 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 SRCS+=		lcd.c
     87 
     88 # XXX dev_net.c should really be in libsa, but it doesn't
     89 #     declare ip_convertaddr correctly.
     90 .PATH: ${LIBSADIR}
     91 SRCS+=		dev_net.c
     92 
     93 SRCS+=		vers.c
     94 CLEANFILES+=	vers.c
     95 
     96 ### find out what to use for libkern
     97 KERN_AS=	library
     98 .include "${S}/lib/libkern/Makefile.inc"
     99 
    100 ### find out what to use for libz
    101 Z_AS=		library
    102 .include "${S}/lib/libz/Makefile.inc"
    103 
    104 ### find out what to use for libsa
    105 SA_AS=		library
    106 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
    107 .include "${S}/lib/libsa/Makefile.inc"
    108 
    109 LIBS=		${SALIB} ${ZLIB} ${KERNLIB}
    110 
    111 .PHONY: vers.c
    112 vers.c: ${.CURDIR}/version
    113 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt"
    114 
    115 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS}
    116 	${LD} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
    117 	    -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS}
    118 	gzip -c9 ${PROG} > ${PROG}.gz
    119 	@${SIZE} ${PROG}
    120 
    121 CLEANFILES+=	${PROG}.map ${PROG}.elf ${PROG}.gz
    122 
    123 cleandir distclean: cleanlibdir
    124 
    125 cleanlibdir:
    126 	-rm -rf lib
    127 
    128 .include <bsd.prog.mk>
    129