xref: /netbsd/sys/arch/sparc/stand/Makefile.buildboot (revision c4a72b64)
1#	$NetBSD: Makefile.buildboot,v 1.18 2002/07/20 11:43:43 mrg 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
11
12SRCS=		${COMMONSOURCE} ${PROGSOURCE}
13NOMAN=		# defined
14BINMODE=	444
15
16#
17# The relocation address for `boot' must leave enough free memory below
18# it to load a kernel at address 0x4000. On the other hand, on some
19# machines, the PROM uses memory in the upper portion of the first 4MB
20# segment, depending on the actual memory bank configuration probably.
21# Our boot program must stear clear of that as well.
22#
23# Relocating `boot' at 0x388000 seems to provide a working compromise
24# on the machines tested so far.
25#
26RELOC_DEFAULT?=	388000
27RELOCS=		$(RELOC_DEFAULT)
28#RELOCS+=	200000 400000 700000		# additional link addresses
29
30# `bootxx' is linked at a different address to circumvent i-cache
31# flushing issues on Hypersparcs
32RELOC_BOOTXX=	300000
33
34CPPFLAGS+=	-D_STANDALONE -DSUN4 -DSUN4C -DHEAP_VARIABLE
35
36CPPFLAGS+=	-I. -I${.CURDIR}/../../.. -I${.CURDIR}/../../../..
37CFLAGS=		-O2
38CFLAGS+=	-Wall -Wstrict-prototypes -Wmissing-prototypes
39
40### find out what to use for libkern
41KERN_AS=	library
42.include "${S}/lib/libkern/Makefile.inc"
43LIBKERN=	${KERNLIB}
44
45.ifdef INCLUDE_LIBZ
46### find out what to use for libz
47Z_AS=		library
48.include "${S}/lib/libz/Makefile.inc"
49LIBZ=		${ZLIB}
50.endif
51
52### find out what to use for libsa
53SA_AS=		library
54SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
55.include "${S}/lib/libsa/Makefile.inc"
56LIBSA=		${SALIB}
57
58.if !make(obj) && !make(clean) && !make(cleandir)
59.BEGIN:
60	@([ -h machine ] || ln -s ${S}/arch/sparc/include machine)
61	@([ -h sparc ] || ln -s ${S}/arch/sparc/include sparc)
62.NOPATH: machine sparc
63.endif
64CLEANFILES+= machine sparc
65