NetBSD/sys/arch/sparc64/conf/Makefile.sparc64

146 lines
3.1 KiB
Makefile

# $NetBSD: Makefile.sparc64,v 1.49 2002/11/26 18:51:17 thorpej Exp $
#=========================================================================
#
# ***** WARNING ******
#
# ANYONE WHO CHANGES THIS MAKEFILE AND DOES NOT TEST BOTH A 32-BIT
# AND 64-BIT KERNEL WILL BE SHOT.
#
#=========================================================================
# Makefile for NetBSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/arch/sparc64/conf/``machineid''
# after which you should do
# config machineid
# Machine generic makefile changes should be made in
# /sys/arch/sparc64/conf/Makefile.sparc64
# after which config should be rerun for all machines of that type.
#
# To specify debugging, add the config line: makeoptions DEBUG="-g"
# A better way is to specify -g only for a few files.
#
# makeoptions DEBUGLIST="uvm* trap if_*"
# Default to 32-bit. Set the MACHINE_ARCH accordingly.
#
# You must also be using the correct toolchain or the kernel build
# will fail.
#
LP64?= no
.if ${LP64} == "yes"
MACHINE_ARCH=sparc64
.else
MACHINE_ARCH=sparc
.endif
USETOOLS?= no
NEED_OWN_INSTALL_TARGET?=no
.include <bsd.own.mk>
##
## (1) port identification
##
SPARC64= $S/arch/sparc64
GENASSYM= ${SPARC64}/sparc64/genassym.cf
##
## (2) compile settings
##
CPPFLAGS+= -Dsparc64 -D__sparc64__
.if ${LP64} == "yes"
# 64-bit kernels
CPPFLAGS+= -D_LP64 -Wa,-Av9a
AFLAGS+= -Wa,-Av9a
.if defined(PROF)
# Profiling is only supported in the medium low memory model.
CFLAGS+= -mcmodel=medlow
.else
# Since the kernel resides in the lower 32 bits, use medium low for now anyway.
CFLAGS+= -mcmodel=medlow
.endif
.else
# 32-bit kernels
CPPFLAGS+= -m32 -Wa,-Av8plusa -mcpu=ultrasparc
AFLAGS+= -Wa,-Av8plusa
.endif
CFLAGS+= -mno-fpu
AFLAGS+= -x assembler-with-cpp -traditional-cpp
NOOPT_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -O0 -c $<
##
## (3) libkern and compat
##
# KERN_AS= obj # bcopy, bzero, memcpy, memset, etc. are in locore.s
##
## (4) local objects, compile rules, and dependencies
##
MD_OBJS= locore.o
MD_CFILES=
MD_SFILES= ${SPARC64}/sparc64/locore.s
locore.o: ${SPARC64}/sparc64/locore.s assym.h
${NORMAL_S}
##
## (5) link settings
##
TEXTADDR?= 01000000
DATAADDR?= 01800000
LINKFORMAT= -n -T ${SPARC64}/conf/${KERN_LDSCRIPT}
.if ${LP64} == "yes"
KERN_LDSCRIPT?= kern.ldscript
.else
KERN_LDSCRIPT?= kern32.ldscript
.endif
##
## (6) port specific target dependencies
##
# depend on CPU configuration
bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
##
## (7) misc settings
##
# define .MAIN _before_ the make() check, so that implicit target
# would be defined
.MAIN: all
.if make(depend) || make(all) || make(dependall)
.BEGIN:
@rm -f sparc && \
ln -s $S/arch/sparc/include sparc
.endif
##
## (8) config(8) generated machinery
##
%INCLUDES
%OBJS
%CFILES
%SFILES
%LOAD
%RULES
##
## (9) port independent kernel machinery
##
.include "$S/conf/Makefile.kern.inc"