Makefile.aarch64 revision 1.3
11.3Sjoerg#	$NetBSD: Makefile.aarch64,v 1.3 2014/08/17 21:17:43 joerg 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.1Smatt#
151.1Smatt# To specify debugging, add the config line: makeoptions DEBUG="-g"
161.1Smatt# A better way is to specify -g only for a few files.
171.1Smatt#
181.1Smatt#	makeoptions DEBUGLIST="uvm* trap if_*"
191.1Smatt
201.1SmattUSETOOLS?=	no
211.1SmattNEED_OWN_INSTALL_TARGET?=no
221.1Smatt.include <bsd.own.mk>
231.1Smatt
241.1Smatt##
251.1Smatt## (1) port identification
261.1Smatt##
271.1SmattTHISA64=	$S/arch/${MACHINE}
281.1SmattA64=		$S/arch/aarch64
291.1SmattGENASSYM_CONF=	${A64}/aarch64/genassym.cf
301.1Smatt.-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc"
311.1Smatt
321.1Smatt##
331.1Smatt## (2) compile settings
341.1Smatt##
351.1Smatt# CPPFLAGS set by platform-specific Makefile fragment.
361.1SmattCFLAGS+=	 -fomit-frame-pointer
371.1Smatt
381.1Smatt##
391.1Smatt## (3) libkern and compat
401.1Smatt##
411.1SmattKERN_AS=	obj
421.1Smatt
431.1Smatt##
441.1Smatt## (4) local objects, compile rules, and dependencies
451.1Smatt##
461.1SmattMD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
471.1SmattMD_CFILES+=
481.1SmattMD_SFILES+=	${SYSTEM_FIRST_SFILE} ${A64}/aarch64/locore.S
491.1Smatt
501.1Smatt.if defined(SYSTEM_FIRST_OBJ)
511.1Smatt${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
521.1Smatt	${NORMAL_S}
531.1Smatt.endif
541.1Smatt
551.1Smattlocore.o: ${A64}/aarch64/locore.S assym.h
561.1Smatt	${NORMAL_S}
571.1Smatt
581.1Smatt##
591.1Smatt## (5) link settings
601.1Smatt##
611.1SmattLDSCRIPT?=	${A64}/conf/kern.ldscript
621.1SmattLOADADDRESS?=	0xFFFFFFFF00000000
631.1SmattLINKFLAGS_NORMAL=	-X
641.1Smatt.if "${LDSCRIPT}" != ""
651.1SmattLINKFLAGS_NORMAL+=	-T ${LDSCRIPT}
661.1Smatt.endif
671.1Smatt
681.1Smatt# Strip AArch64 mapping symbols from the kernel image, as they interfere
691.1Smatt# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
701.1Smatt.if !defined(DEBUG) || empty(DEBUG:M-g*)
711.3SjoergSYSTEM_LD_TAIL?=	${OBJCOPY} -w --strip-symbol='[$$][dx]'	\
721.2Sjoerg				   --strip-symbol='[$$][dx]\.*' $@ ;\
731.1Smatt			${SIZE} $@; chmod 755 $@
741.1Smatt.else
751.1SmattSTRIPFLAGS=-g --strip-symbol='$$x' --strip-symbol='$$d'
761.1Smatt.endif
771.1Smatt
781.1Smatt##
791.1Smatt## (6) port specific target dependencies
801.1Smatt##
811.1Smatt
821.1Smatt# depend on DIAGNOSTIC etc.
831.1Smattcpuswitch.o fault.o machdep.o: Makefile
841.1Smatt
851.1Smatt# various assembly files that depend on assym.h
861.1Smattatomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h
871.1Smattexception.o sigcode.o: assym.h
881.1Smattspl.o vectors.o: assym.h
891.1Smatt
901.1Smatt##
911.1Smatt## (7) misc settings
921.1Smatt##
931.1Smatt
941.1Smatt##
951.1Smatt## (8) config(8) generated machinery
961.1Smatt##
971.1Smatt%INCLUDES
981.1Smatt
991.1Smatt%OBJS
1001.1Smatt
1011.1Smatt%CFILES
1021.1Smatt
1031.1Smatt%SFILES
1041.1Smatt
1051.1Smatt%LOAD
1061.1Smatt
1071.1Smatt%RULES
1081.1Smatt
1091.1Smatt##
1101.1Smatt## (9) after the config file is inserted
1111.1Smatt##
1121.1Smatt
1131.1Smatt##
1141.1Smatt## (10) port independent kernel machinery
1151.1Smatt##
1161.1Smatt
1171.1Smatt.include "$S/conf/Makefile.kern.inc"
1181.1Smatt
1191.1Smatt##
1201.1Smatt## (11) Appending make options.
1211.1Smatt##
1221.1Smatt%MAKEOPTIONSAPPEND
123