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