Makefile.sparc64 revision 1.73
11.73Schristos# 	$NetBSD: Makefile.sparc64,v 1.73 2013/03/19 19:59:40 christos Exp $
21.45Seeh
31.45Seeh#=========================================================================
41.45Seeh#
51.45Seeh#			***** WARNING ******
61.45Seeh#
71.45Seeh# ANYONE WHO CHANGES THIS MAKEFILE AND DOES NOT TEST BOTH A 32-BIT
81.45Seeh# AND 64-BIT KERNEL WILL BE SHOT.
91.45Seeh#
101.45Seeh#=========================================================================
111.45Seeh
121.1Seeh
131.1Seeh# Makefile for NetBSD
141.1Seeh#
151.1Seeh# This makefile is constructed from a machine description:
161.1Seeh#	config machineid
171.1Seeh# Most changes should be made in the machine description
181.1Seeh#	/sys/arch/sparc64/conf/``machineid''
191.1Seeh# after which you should do
201.1Seeh#	config machineid
211.1Seeh# Machine generic makefile changes should be made in
221.1Seeh#	/sys/arch/sparc64/conf/Makefile.sparc64
231.1Seeh# after which config should be rerun for all machines of that type.
241.44Satatat#
251.44Satatat# To specify debugging, add the config line: makeoptions DEBUG="-g"
261.44Satatat# A better way is to specify -g only for a few files.
271.44Satatat#
281.44Satatat#	makeoptions DEBUGLIST="uvm* trap if_*"
291.1Seeh
301.45Seeh# Default to 32-bit.  Set the MACHINE_ARCH accordingly.
311.45Seeh#
321.45Seeh# You must also be using the correct toolchain or the kernel build
331.45Seeh# will fail.
341.45Seeh#
351.41SthorpejLP64?=	no
361.41Sthorpej.if ${LP64} == "yes"
371.40SthorpejMACHINE_ARCH=sparc64
381.41Sthorpej.else
391.41SthorpejMACHINE_ARCH=sparc
401.41Sthorpej.endif
411.42Sjmc
421.42SjmcUSETOOLS?=	no
431.44SatatatNEED_OWN_INSTALL_TARGET?=no
441.39Sthorpej.include <bsd.own.mk>
451.39Sthorpej
461.44Satatat##
471.44Satatat## (1) port identification
481.44Satatat##
491.1SeehSPARC64=	$S/arch/sparc64
501.56SchristosGENASSYM_CONF=	${SPARC64}/sparc64/genassym.cf
511.1Seeh
521.44Satatat##
531.44Satatat## (2) compile settings
541.44Satatat##
551.45SeehCPPFLAGS+=	-Dsparc64 -D__sparc64__
561.40Sthorpej.if ${LP64} == "yes"
571.45Seeh# 64-bit kernels
581.45SeehCPPFLAGS+=	-D_LP64 -Wa,-Av9a
591.45SeehAFLAGS+=	-Wa,-Av9a
601.30Seeh.if defined(PROF)
611.45Seeh# Profiling is only supported in the medium low memory model.
621.45SeehCFLAGS+=	-mcmodel=medlow
631.45Seeh.else
641.45Seeh# Since the kernel resides in the lower 32 bits, use medium low for now anyway.
651.40SthorpejCFLAGS+=	-mcmodel=medlow
661.30Seeh.endif
671.45Seeh.else
681.45Seeh# 32-bit kernels
691.45SeehCPPFLAGS+=	-m32 -Wa,-Av8plusa -mcpu=ultrasparc
701.45SeehAFLAGS+=	-Wa,-Av8plusa
711.45Seeh.endif
721.45SeehCFLAGS+=	-mno-fpu
731.70SjoergAFLAGS+=	-x assembler-with-cpp
741.44Satatat
751.44Satatat##
761.44Satatat## (3) libkern and compat
771.44Satatat##
781.72SchristosOPT_MODULAR=	%MODULAR%
791.72Schristos.if !empty(OPT_MODULAR)
801.72SchristosKERN_AS=	obj
811.72Schristos.else
821.72SchristosKERN_AS=	library
831.72Schristos.endif
841.44Satatat
851.44Satatat##
861.44Satatat## (4) local objects, compile rules, and dependencies
871.44Satatat##
881.69SmartinMD_OBJS=	locore.o copy.o mp_subr.o
891.44SatatatMD_CFILES=
901.69SmartinMD_SFILES=	${SPARC64}/sparc64/locore.s ${SPARC64}/sparc64/copy.S \
911.69Smartin	 ${SPARC64}/sparc64/mp_subr.S
921.31Seeh
931.44Satatatlocore.o: ${SPARC64}/sparc64/locore.s assym.h
941.44Satatat	${NORMAL_S}
951.51Schristos
961.69Smartincopy.o:	${SPARC64}/sparc64/copy.S assym.h
971.69Smartin	${NORMAL_S}
981.69Smartin
991.69Smartinmp_subr.o:	${SPARC64}/sparc64/mp_subr.S assym.h
1001.69Smartin	${NORMAL_S}
1011.69Smartin
1021.73Schristos# Our libkern needs stuff from assym.h for memcpy and memset.
1031.73Schristosdependkernlib:	assym.h
1041.73Schristos
1051.44Satatat##
1061.44Satatat## (5) link settings
1071.44Satatat##
1081.44SatatatTEXTADDR?=	01000000
1091.67SmartinLINKFORMAT=	-T ${SPARC64}/conf/${KERN_LDSCRIPT}
1101.40Sthorpej.if ${LP64} == "yes"
1111.34SmrgKERN_LDSCRIPT?= kern.ldscript
1121.35Smrg.else
1131.35SmrgKERN_LDSCRIPT?= kern32.ldscript
1141.35Smrg.endif
1151.31Seeh
1161.44Satatat##
1171.44Satatat## (6) port specific target dependencies
1181.44Satatat##
1191.10Smrg
1201.44Satatat# depend on CPU configuration
1211.44Satatatbwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
1221.44Satatatms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
1231.44Satatatmachdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
1241.44Satatat
1251.66Sjoergcpu_in_cksum.o lock_stubs.o: assym.h
1261.66Sjoerg
1271.44Satatat##
1281.44Satatat## (7) misc settings
1291.44Satatat##
1301.48Sjdolecek
1311.48Sjdolecek# define .MAIN _before_ the make() check, so that implicit target
1321.48Sjdolecek# would be defined
1331.48Sjdolecek.MAIN: all
1341.47Smrg
1351.47Smrg.if make(depend) || make(all) || make(dependall)
1361.47Smrg.BEGIN:
1371.47Smrg	@rm -f sparc && \
1381.47Smrg		ln -s $S/arch/sparc/include sparc
1391.47Smrg.endif
1401.44Satatat
1411.44Satatat##
1421.44Satatat## (8) config(8) generated machinery
1431.44Satatat##
1441.10Smrg%INCLUDES
1451.1Seeh
1461.1Seeh%OBJS
1471.1Seeh
1481.1Seeh%CFILES
1491.1Seeh
1501.1Seeh%SFILES
1511.1Seeh
1521.1Seeh%LOAD
1531.2Smrg
1541.44Satatat%RULES
1551.1Seeh
1561.44Satatat##
1571.44Satatat## (9) port independent kernel machinery
1581.44Satatat##
1591.44Satatat.include "$S/conf/Makefile.kern.inc"
1601.55Sthorpej
1611.55Sthorpej##
1621.55Sthorpej## (10) Appending make options.
1631.55Sthorpej##
1641.55Sthorpej%MAKEOPTIONSAPPEND
165