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