11.32Schristos#	$NetBSD: Makefile.buildboot,v 1.32 2016/10/01 13:57:44 christos Exp $
21.18Smrg#
31.18Smrg# This file is for the sparc `boot' and `bootxx' only; it does not
41.18Smrg# currently play well on a 64-bit system.
51.1Smrg
61.32SchristosNOSSP=		# defined
71.32SchristosNOPIE=		# defined
81.32SchristosNOMAN=		# defined
91.32Schristos
101.1SmrgS=	${.CURDIR}/../../../..
111.1Smrg
121.4Spk.PATH: ${.CURDIR}/../common ${.CURDIR}/../../sparc
131.1Smrg
141.28SchristosCOMMONSOURCE=	srt0.S promdev.c dvma.c promlib.c isfloppy.c
151.1Smrg
161.1SmrgSRCS=		${COMMONSOURCE} ${PROGSOURCE}
171.1SmrgBINMODE=	444
181.1Smrg
191.31Smartin.include <bsd.own.mk>
201.31Smartin
211.15Spk#
221.15Spk# The relocation address for `boot' must leave enough free memory below
231.15Spk# it to load a kernel at address 0x4000. On the other hand, on some
241.15Spk# machines, the PROM uses memory in the upper portion of the first 4MB
251.15Spk# segment, depending on the actual memory bank configuration probably.
261.15Spk# Our boot program must stear clear of that as well.
271.15Spk#
281.15Spk# Relocating `boot' at 0x388000 seems to provide a working compromise
291.15Spk# on the machines tested so far.
301.15Spk#
311.15SpkRELOC_DEFAULT?=	388000
321.14SpkRELOCS=		$(RELOC_DEFAULT)
331.14Spk#RELOCS+=	200000 400000 700000		# additional link addresses
341.14Spk
351.11Spk# `bootxx' is linked at a different address to circumvent i-cache
361.11Spk# flushing issues on Hypersparcs
371.14SpkRELOC_BOOTXX=	300000
381.1Smrg
391.19SpkCPPFLAGS+=	-D_STANDALONE -DSUN4 -DSUN4C -DSUN4M -DSUN4D -DHEAP_VARIABLE
401.1Smrg
411.5SpkCPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
421.26StsutsuiCPPFLAGS+=	-I${.CURDIR}/../../../../../common/include
431.30SjoergCFLAGS=		${${ACTIVE_CC} == "clang":? -Oz -fomit-frame-pointer : -Os } -fno-unwind-tables
441.30SjoergAFLAGS+=	${${ACTIVE_CC} == "clang":? -Oz :}
451.21SmrgCFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes -ffreestanding
461.1Smrg
471.1Smrg### find out what to use for libkern
481.1SmrgKERN_AS=	library
491.1Smrg.include "${S}/lib/libkern/Makefile.inc"
501.1SmrgLIBKERN=	${KERNLIB}
511.1Smrg
521.1Smrg.ifdef INCLUDE_LIBZ
531.1Smrg### find out what to use for libz
541.1SmrgZ_AS=		library
551.1Smrg.include "${S}/lib/libz/Makefile.inc"
561.1SmrgLIBZ=		${ZLIB}
571.1Smrg.endif
581.1Smrg
591.1Smrg### find out what to use for libsa
601.1SmrgSA_AS=		library
611.6SchristosSAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
621.1Smrg.include "${S}/lib/libsa/Makefile.inc"
631.1SmrgLIBSA=		${SALIB}
641.5Spk
651.25Stsutsui.include <bsd.klinks.mk>
661.20Snakayama
671.27Sdhollandcleandir distclean: .WAIT cleanlibdir
681.20Snakayama
691.20Snakayamacleanlibdir:
701.22Sjmc	-rm -rf lib
71