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