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