xref: /netbsd-src/sys/arch/sparc/stand/Makefile.buildboot (revision 92e958de60c71aa0f2452bd7074cbb006fe6546b)
1#	$NetBSD: Makefile.buildboot,v 1.31 2016/03/10 09:00:24 martin Exp $
2#
3# This file is for the sparc `boot' and `bootxx' only; it does not
4# currently play well on a 64-bit system.
5
6S=	${.CURDIR}/../../../..
7
8.PATH: ${.CURDIR}/../common ${.CURDIR}/../../sparc
9
10COMMONSOURCE=	srt0.S promdev.c dvma.c promlib.c isfloppy.c
11
12SRCS=		${COMMONSOURCE} ${PROGSOURCE}
13NOMAN=		# defined
14BINMODE=	444
15
16.include <bsd.own.mk>
17
18#
19# The relocation address for `boot' must leave enough free memory below
20# it to load a kernel at address 0x4000. On the other hand, on some
21# machines, the PROM uses memory in the upper portion of the first 4MB
22# segment, depending on the actual memory bank configuration probably.
23# Our boot program must stear clear of that as well.
24#
25# Relocating `boot' at 0x388000 seems to provide a working compromise
26# on the machines tested so far.
27#
28RELOC_DEFAULT?=	388000
29RELOCS=		$(RELOC_DEFAULT)
30#RELOCS+=	200000 400000 700000		# additional link addresses
31
32# `bootxx' is linked at a different address to circumvent i-cache
33# flushing issues on Hypersparcs
34RELOC_BOOTXX=	300000
35
36CPPFLAGS+=	-D_STANDALONE -DSUN4 -DSUN4C -DSUN4M -DSUN4D -DHEAP_VARIABLE
37
38CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
39CPPFLAGS+=	-I${.CURDIR}/../../../../../common/include
40CFLAGS=		${${ACTIVE_CC} == "clang":? -Oz -fomit-frame-pointer : -Os } -fno-unwind-tables
41AFLAGS+=	${${ACTIVE_CC} == "clang":? -Oz :}
42CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes -ffreestanding
43
44### find out what to use for libkern
45KERN_AS=	library
46.include "${S}/lib/libkern/Makefile.inc"
47LIBKERN=	${KERNLIB}
48
49.ifdef INCLUDE_LIBZ
50### find out what to use for libz
51Z_AS=		library
52.include "${S}/lib/libz/Makefile.inc"
53LIBZ=		${ZLIB}
54.endif
55
56### find out what to use for libsa
57SA_AS=		library
58SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
59.include "${S}/lib/libsa/Makefile.inc"
60LIBSA=		${SALIB}
61
62.include <bsd.klinks.mk>
63
64cleandir distclean: .WAIT cleanlibdir
65
66cleanlibdir:
67	-rm -rf lib
68