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