Makefile.arm revision 1.38
11.38Smatt# $NetBSD: Makefile.arm,v 1.38 2013/10/28 22:52:04 matt 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.35SmattCOPTS.arm32_kvminit.c+= -fno-stack-protector 381.38SmattAFLAGS.bcopyinout.S+=-marm 391.38SmattAFLAGS.cpuswitch.S+=-marm 401.38SmattAFLAGS.locore.S+=-marm 411.38SmattAFLAGS.fusu.S+=-marm 421.38SmattAFLAGS.exception.S+=-marm 431.38SmattAFLAGS.irq_dispatch.S+=-marm 441.38SmattAFLAGS.blockio.S+=-marm 451.38SmattAFLAGS.copystr.S+=-marm 461.37SskrllCFLAGS+= -mfloat-abi=soft 471.15Satatat 481.15Satatat## 491.15Satatat## (3) libkern and compat 501.15Satatat## 511.15SatatatKERN_AS= obj 521.1Smatt 531.38Smatt 541.15Satatat## 551.15Satatat## (4) local objects, compile rules, and dependencies 561.15Satatat## 571.28SscwMD_OBJS+= ${SYSTEM_FIRST_OBJ} locore.o 581.28SscwMD_CFILES+= 591.28SscwMD_SFILES+= ${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S 601.7Smatt 611.15Satatat.if defined(SYSTEM_FIRST_OBJ) 621.15Satatat${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h 631.15Satatat ${NORMAL_S} 641.7Smatt.endif 651.1Smatt 661.15Satatatlocore.o: ${ARM}/arm32/locore.S assym.h 671.15Satatat ${NORMAL_S} 681.1Smatt 691.15Satatat## 701.15Satatat## (5) link settings 711.15Satatat## 721.3SmattLOADADDRESS?= 0xF0000000 731.15SatatatLINKFLAGS_NORMAL= -X 741.25Sscw# Strip ARM mapping symbols from the kernel image, as they interfere 751.27Sdbj# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified. 761.27Sdbj.if !defined(DEBUG) || empty(DEBUG:M-g*) 771.34SskrllSYSTEM_LD_TAIL?= ${SYSTEM_LD_TAIL_DBSYM} ; \ 781.33Sbsh ${OBJCOPY} --strip-symbol='$$a' \ 791.27Sdbj --strip-symbol='$$t' \ 801.27Sdbj --strip-symbol='$$d' $@ ;\ 811.27Sdbj ${SIZE} $@; chmod 755 $@ 821.27Sdbj.else 831.26SdbjSTRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d' 841.27Sdbj.endif 851.1Smatt 861.15Satatat## 871.15Satatat## (6) port specific target dependencies 881.15Satatat## 891.1Smatt 901.15Satatat# depend on CPU configuration 911.15Satatatcpufunc.o cpufunc_asm.o: Makefile 921.1Smatt 931.15Satatat# depend on DIAGNOSTIC etc. 941.15Satatatcpuswitch.o fault.o machdep.o: Makefile 951.1Smatt 961.22Ssimonb# various assembly files that depend on assym.h 971.31Schrisatomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h 981.31Schrisexception.o fiq_subr.o fusu.o irq_dispatch.o isa_irq.o sigcode.o: assym.h 991.23Ssimonbspl.o vectors.o: assym.h 1001.22Ssimonb 1011.15Satatat## 1021.15Satatat## (7) misc settings 1031.15Satatat## 1041.19Sskrll 1051.15Satatat## 1061.15Satatat## (8) config(8) generated machinery 1071.15Satatat## 1081.15Satatat%INCLUDES 1091.1Smatt 1101.1Smatt%OBJS 1111.1Smatt 1121.1Smatt%CFILES 1131.1Smatt 1141.1Smatt%SFILES 1151.1Smatt 1161.1Smatt%LOAD 1171.1Smatt 1181.15Satatat%RULES 1191.1Smatt 1201.15Satatat## 1211.38Smatt## (9) after the config file is inserted 1221.38Smatt## 1231.38Smatt 1241.38Smatt.for f in ${SFILES:T:Mcpufunc_asm*} 1251.38SmattAFLAGS.${f}+=-marm 1261.38Smatt.endfor 1271.38Smatt 1281.38Smatt## 1291.38Smatt## (10) port independent kernel machinery 1301.15Satatat## 1311.38Smatt 1321.15Satatat.include "$S/conf/Makefile.kern.inc" 1331.21Sthorpej 1341.21Sthorpej## 1351.38Smatt## (11) Appending make options. 1361.21Sthorpej## 1371.21Sthorpej%MAKEOPTIONSAPPEND 138