Home | History | Annotate | Line # | Download | only in boot
Makefile revision 1.6
      1 #	$NetBSD: Makefile,v 1.6 2004/01/27 21:03:18 cdi 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 
     12 # .PATH:	${.CURDIR}/../common
     13 
     14 BINMODE?= 444
     15 
     16 # XXX SHOULD NOT NEED TO DEFINE THESE!
     17 LIBCRT0=
     18 LIBC=
     19 LIBCRTBEGIN=
     20 LIBCRTEND=
     21 
     22 .PHONY:		machine-links
     23 beforedepend:	machine-links
     24 
     25 machine-links:	machine cobalt mips
     26 machine cobalt:
     27 	-rm -f ${.TARGET}
     28 	ln -s ${COBALT}/include ${.TARGET}
     29 
     30 mips:
     31 	-rm -f ${.TARGET}
     32 	ln -s ${MIPS}/include ${.TARGET}
     33 
     34 CLEANFILES+=	machine cobalt mips
     35 
     36 realall: machine-links ${PROG}
     37 
     38 # Load @15Mb boundary as most (all?) of the Cobalt boxes
     39 # had been shipped with at least 16Mb.
     40 #
     41 # XXX The proper fix is to load at the kernel base address
     42 # and to relocate itself at the end of available memory.
     43 LOAD_ADDRESS?=0x80F00000
     44 
     45 COMPORT?=0x0
     46 COMBASE?=0xbc800000
     47 COMSPEED?=115200
     48 COMPROBE?=0xa020001c
     49 
     50 AFLAGS+=	-D_LOCORE -D_KERNEL -DASSEMBLER -mno-abicalls
     51 
     52 # -I${.CURDIR}/../.. done by Makefile.inc
     53 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -D_NO_PROM_DEFINES
     54 # CPPFLAGS+=	-D_DEBUG
     55 CPPFLAGS+=	-I${.OBJDIR} -I${S} -I${S}/lib/libsa
     56 CPPFLAGS+=	-DCONS_SERIAL -DCOMBASE=${COMBASE} -DCOMPORT=${COMPORT}
     57 CPPFLAGS+=	-DCOMSPEED=${COMSPEED} -DCOMPROBE=${COMPROBE}
     58 
     59 # compiler flags for smallest code size
     60 CFLAGS=		-Os -mmemcpy -ffreestanding -mno-abicalls -msoft-float -G 128
     61 OFORMAT=	--oformat elf32-littlemips
     62 
     63 NETBSD_VERS!=	${HOST_SH} ${S}/conf/osrelease.sh
     64 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     65 
     66 LDSCRIPT?=	${MIPS}/conf/stand.ldscript
     67 
     68 PROG=		boot
     69 # common sources
     70 SRCS+=		start.S boot.c devopen.c conf.c clock.c bootinfo.c
     71 SRCS+=		prf.c com.c cons.c ns16550.c pciide.c wdc.c wd.c
     72 
     73 SRCS+=		vers.c
     74 CLEANFILES+=	vers.c
     75 
     76 ### find out what to use for libkern
     77 KERN_AS=	library
     78 .include "${S}/lib/libkern/Makefile.inc"
     79 
     80 ### find out what to use for libz
     81 Z_AS=		library
     82 .include "${S}/lib/libz/Makefile.inc"
     83 
     84 ### find out what to use for libsa
     85 SA_AS=		library
     86 SAMISCMAKEFLAGS+=SA_USE_LOADFILE=yes SA_USE_CREAD=yes
     87 .include "${S}/lib/libsa/Makefile.inc"
     88 
     89 LIBS=		${KERNLIB} ${SALIB} ${ZLIB}
     90 
     91 .PHONY: vers.c
     92 vers.c: ${.CURDIR}/version
     93 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.CURDIR}/version "cobalt"
     94 
     95 ${PROG}: machine-links ${LDSCRIPT} ${OBJS} ${LIBS}
     96 	${LD} ${OFORMAT} -Map ${PROG}.map -N -x -Ttext ${LOAD_ADDRESS} \
     97 	    -T ${LDSCRIPT} -e start -o ${PROG} ${OBJS} ${LIBS}
     98 	gzip -c9 ${PROG} > ${PROG}.gz
     99 	@${SIZE} ${PROG}
    100 
    101 CLEANFILES+=	${PROG}.map ${PROG}.elf ${PROG}.gz
    102 
    103 cleandir distclean: cleanlibdir
    104 
    105 cleanlibdir:
    106 	rm -rf lib
    107 
    108 .include <bsd.prog.mk>
    109