Home | History | Annotate | Line # | Download | only in boot64
Makefile revision 1.9
      1 #	$NetBSD: Makefile,v 1.9 2011/01/23 13:18:02 joerg Exp $
      2 
      3 PROG=	ip30boot
      4 NOMAN=	# defined
      5 
      6 SRCS=	start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
      7 	getopt.c disk.c
      8 
      9 CLEANFILES+=	boot.map
     10 
     11 .include <bsd.own.mk>
     12 .include <bsd.sys.mk>		# for HOST_SH
     13 
     14 # $S must correspond to the top of the 'sys' tree
     15 S=	${.CURDIR}/../../../..
     16 
     17 BINMODE?=	444
     18 
     19 realall: ${PROG}
     20 
     21 .PATH:		${.CURDIR}/../common
     22 AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls -mabi=64 -D_LP64
     23 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
     24 # compiler flags for smallest code size
     25 CFLAGS=		-ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024 -mabi=64 -D_LP64
     26 LDBUG=		-T $S/arch/mips/conf/stand.ldscript
     27 NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
     28 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     29 
     30 CPPFLAGS+=	-Dsgimips
     31 
     32 # We load the kernel at 420K in from the start of RAM to give the boot
     33 # loader plenty of breathing room.  Load the boot loader starting at
     34 # the second page of RAM.
     35 
     36 LOAD_ADDRESS_IP30?=	0xa800000020080000
     37 
     38 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     39 # and CLEANFILES
     40 .if exists(version)
     41 .PHONY: vers.c
     42 vers.c: ${.CURDIR}/version
     43 	${HOST_SH} ${S}/conf/newvers_stand.sh ${${MKREPRO} == "yes" :?:-D} \
     44 	    ${.CURDIR}/version "sgimips"
     45 
     46 SRCS+=	vers.c
     47 CLEANFILES+= vers.c
     48 .endif
     49 
     50 ### find out what to use for libkern
     51 KERN_AS=	library
     52 KERNMISCMAKEFLAGS+=	LD="${LD} -m elf64btsmip" RANLIB="true"
     53 .include "${S}/lib/libkern/Makefile.inc"
     54 LIBKERN=	${KERNLIB}
     55 
     56 ### find out what to use for libz
     57 Z_AS=		library
     58 ZMISCMAKEFLAGS+=	LD="${LD} -m elf64btsmip" RANLIB="true"
     59 .include "${S}/lib/libz/Makefile.inc"
     60 LIBZ=		${ZLIB}
     61 
     62 ### find out what to use for libsa
     63 SA_AS=		library
     64 SAMISCMAKEFLAGS+=	SA_USE_LOADFILE=yes SA_USE_CREAD=yes \
     65 			LD="${LD} -m elf64btsmip" RANLIB="true"
     66 .include "${S}/lib/libsa/Makefile.inc"
     67 LIBSA=		${SALIB}
     68 
     69 
     70 LIBS=		${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN}
     71 
     72 ip30boot: ${OBJS} ${LIBS}
     73 	${LD} -m elf64btsmip -Map boot.map -x -Ttext ${LOAD_ADDRESS_IP30} \
     74 		${LDBUG} -e start -o ${.TARGET} ${OBJS} ${LIBS}
     75 
     76 cleandir distclean: .WAIT cleanlibdir
     77 cleanlibdir:
     78 	-rm -rf lib
     79 
     80 .include <bsd.klinks.mk>
     81 .include <bsd.prog.mk>
     82