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