Home | History | Annotate | Line # | Download | only in boot64
Makefile revision 1.7
      1 #	$NetBSD: Makefile,v 1.7 2010/05/27 06:58:15 dholland Exp $
      2 
      3 PROG=	ip30boot
      4 
      5 SRCS=	start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
      6 	getopt.c disk.c
      7 
      8 CLEANFILES+=	boot.map
      9 
     10 .include <bsd.sys.mk>		# for HOST_SH
     11 
     12 # $S must correspond to the top of the 'sys' tree
     13 S=	${.CURDIR}/../../../..
     14 
     15 BINMODE?=	444
     16 
     17 realall: ${PROG}
     18 
     19 .PATH:		${.CURDIR}/../common
     20 AFLAGS+=	-D_LOCORE -D_KERNEL -mno-abicalls -mabi=64 -D_LP64
     21 CPPFLAGS+=	-nostdinc -D_STANDALONE -DNO_ABICALLS -I${.OBJDIR} -I${S}
     22 # compiler flags for smallest code size
     23 CFLAGS=		-ffreestanding -Os -Wall -Werror -mno-abicalls -msoft-float -G 1024 -mabi=64 -D_LP64
     24 LDBUG=		-T $S/arch/mips/conf/stand.ldscript
     25 NETBSD_VERS!=	${HOST_SH} ${.CURDIR}/../../../../conf/osrelease.sh
     26 CPPFLAGS+=	-DNETBSD_VERS='"${NETBSD_VERS}"'
     27 
     28 CPPFLAGS+=	-Dsgimips
     29 
     30 # PROG set by parent.
     31 NOMAN=		# defined
     32 
     33 # We load the kernel at 420K in from the start of RAM to give the boot
     34 # loader plenty of breathing room.  Load the boot loader starting at
     35 # the second page of RAM.
     36 
     37 LOAD_ADDRESS_IP30?=	0xa800000020080000
     38 
     39 # if there is a 'version' file, add rule for vers.c and add it to SRCS
     40 # and CLEANFILES
     41 .if exists(version)
     42 .PHONY: vers.c
     43 vers.c: ${.CURDIR}/version
     44 	${HOST_SH} ${S}/conf/newvers_stand.sh ${.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