Makefile.arm revision 1.31
11.31Schris#	$NetBSD: Makefile.arm,v 1.31 2008/01/26 02:06:04 chris Exp $
21.1Smatt
31.1Smatt# Makefile for NetBSD
41.1Smatt#
51.1Smatt# This makefile is constructed from a machine description:
61.1Smatt#	config machineid
71.1Smatt# Most changes should be made in the machine description
81.1Smatt#	/sys/arch/<arch>/conf/``machineid''
91.1Smatt# after which you should do
101.1Smatt#	config machineid
111.1Smatt# Machine generic makefile changes should be made in
121.1Smatt#	/sys/arch/arm/conf/Makefile.arm
131.1Smatt# after which config should be rerun for all machines of that type.
141.15Satatat#
151.15Satatat# To specify debugging, add the config line: makeoptions DEBUG="-g"
161.15Satatat# A better way is to specify -g only for a few files.
171.15Satatat#
181.15Satatat#	makeoptions DEBUGLIST="uvm* trap if_*"
191.10Sjmc
201.10SjmcUSETOOLS?=	no
211.15SatatatNEED_OWN_INSTALL_TARGET?=no
221.8Sthorpej.include <bsd.own.mk>
231.1Smatt
241.15Satatat##
251.15Satatat## (1) port identification
261.15Satatat##
271.15SatatatTHISARM=	$S/arch/${MACHINE}
281.15SatatatARM=		$S/arch/arm
291.24SchristosGENASSYM_CONF=	${ARM}/arm32/genassym.cf
301.15Satatat.-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc"
311.1Smatt
321.15Satatat##
331.15Satatat## (2) compile settings
341.15Satatat##
351.18Sthorpej# CPPFLAGS set by platform-specific Makefile fragment.
361.15SatatatAFLAGS+=	-x assembler-with-cpp
371.15Satatat
381.15Satatat##
391.15Satatat## (3) libkern and compat
401.15Satatat##
411.15SatatatKERN_AS=	obj
421.1Smatt
431.15Satatat##
441.15Satatat## (4) local objects, compile rules, and dependencies
451.15Satatat##
461.28SscwMD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
471.28SscwMD_CFILES+=
481.28SscwMD_SFILES+=	${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S
491.7Smatt
501.15Satatat.if defined(SYSTEM_FIRST_OBJ)
511.15Satatat${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
521.15Satatat	${NORMAL_S}
531.7Smatt.endif
541.1Smatt
551.15Satatatlocore.o: ${ARM}/arm32/locore.S assym.h
561.15Satatat	${NORMAL_S}
571.1Smatt
581.15Satatat##
591.15Satatat## (5) link settings
601.15Satatat##
611.3SmattLOADADDRESS?=	0xF0000000
621.15SatatatLINKFLAGS_NORMAL=	-X
631.25Sscw# Strip ARM mapping symbols from the kernel image, as they interfere
641.27Sdbj# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
651.27Sdbj.if !defined(DEBUG) || empty(DEBUG:M-g*)
661.27SdbjSYSTEM_LD_TAIL?=	@${OBJCOPY} --strip-symbol='$$a'	 \
671.27Sdbj				    --strip-symbol='$$t'	 \
681.27Sdbj				    --strip-symbol='$$d' $@	;\
691.27Sdbj			${SIZE} $@; chmod 755 $@
701.27Sdbj.else
711.26SdbjSTRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d'
721.27Sdbj.endif
731.1Smatt
741.15Satatat##
751.15Satatat## (6) port specific target dependencies
761.15Satatat##
771.1Smatt
781.15Satatat# depend on CPU configuration
791.15Satatatcpufunc.o cpufunc_asm.o: Makefile
801.1Smatt
811.15Satatat# depend on DIAGNOSTIC etc.
821.15Satatatcpuswitch.o fault.o machdep.o: Makefile
831.1Smatt
841.22Ssimonb# various assembly files that depend on assym.h
851.31Schrisatomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h
861.31Schrisexception.o fiq_subr.o fusu.o irq_dispatch.o isa_irq.o sigcode.o: assym.h
871.23Ssimonbspl.o vectors.o: assym.h
881.22Ssimonb
891.15Satatat##
901.15Satatat## (7) misc settings
911.15Satatat##
921.19Sskrll
931.19Sskrll# XXX gcc 3.3 generates incorrect code without this
941.19Sskrll# XXX see PR 23044
951.20SskrllCOPTS.uipc_socket.c+=	-fno-strict-aliasing
961.15Satatat
971.15Satatat##
981.15Satatat## (8) config(8) generated machinery
991.15Satatat##
1001.15Satatat%INCLUDES
1011.1Smatt
1021.1Smatt%OBJS
1031.1Smatt
1041.1Smatt%CFILES
1051.1Smatt
1061.1Smatt%SFILES
1071.1Smatt
1081.1Smatt%LOAD
1091.1Smatt
1101.15Satatat%RULES
1111.1Smatt
1121.15Satatat##
1131.15Satatat## (9) port independent kernel machinery
1141.15Satatat##
1151.15Satatat.include "$S/conf/Makefile.kern.inc"
1161.21Sthorpej
1171.21Sthorpej##
1181.21Sthorpej## (10) Appending make options.
1191.21Sthorpej##
1201.21Sthorpej%MAKEOPTIONSAPPEND
121