Makefile.arm revision 1.39
1#	$NetBSD: Makefile.arm,v 1.39 2013/12/27 04:41:29 matt Exp $
2
3# Makefile for NetBSD
4#
5# This makefile is constructed from a machine description:
6#	config machineid
7# Most changes should be made in the machine description
8#	/sys/arch/<arch>/conf/``machineid''
9# after which you should do
10#	config machineid
11# Machine generic makefile changes should be made in
12#	/sys/arch/arm/conf/Makefile.arm
13# after which config should be rerun for all machines of that type.
14#
15# To specify debugging, add the config line: makeoptions DEBUG="-g"
16# A better way is to specify -g only for a few files.
17#
18#	makeoptions DEBUGLIST="uvm* trap if_*"
19
20USETOOLS?=	no
21NEED_OWN_INSTALL_TARGET?=no
22.include <bsd.own.mk>
23
24##
25## (1) port identification
26##
27THISARM=	$S/arch/${MACHINE}
28ARM=		$S/arch/arm
29GENASSYM_CONF=	${ARM}/arm32/genassym.cf
30.-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc"
31
32##
33## (2) compile settings
34##
35# CPPFLAGS set by platform-specific Makefile fragment.
36AFLAGS+=	-x assembler-with-cpp
37COPTS.arm32_kvminit.c+=		-fno-stack-protector
38AFLAGS.bcopyinout.S+=-marm
39AFLAGS.cpuswitch.S+=-marm -mfpu=vfp
40AFLAGS.locore.S+=-marm
41AFLAGS.fusu.S+=-marm
42AFLAGS.exception.S+=-marm
43AFLAGS.irq_dispatch.S+=-marm
44AFLAGS.blockio.S+=-marm
45AFLAGS.copystr.S+=-marm
46CFLAGS+=	 -mfloat-abi=soft
47
48##
49## (3) libkern and compat
50##
51KERN_AS=	obj
52
53
54##
55## (4) local objects, compile rules, and dependencies
56##
57MD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
58MD_CFILES+=
59MD_SFILES+=	${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S
60
61.if defined(SYSTEM_FIRST_OBJ)
62${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
63	${NORMAL_S}
64.endif
65
66locore.o: ${ARM}/arm32/locore.S assym.h
67	${NORMAL_S}
68
69##
70## (5) link settings
71##
72LOADADDRESS?=	0xF0000000
73LINKFLAGS_NORMAL=	-X
74# Strip ARM mapping symbols from the kernel image, as they interfere
75# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
76.if !defined(DEBUG) || empty(DEBUG:M-g*)
77SYSTEM_LD_TAIL?=	${SYSTEM_LD_TAIL_DBSYM} ; \
78			${OBJCOPY} --strip-symbol='$$a'	 \
79				    --strip-symbol='$$t'	 \
80				    --strip-symbol='$$d' $@	;\
81			${SIZE} $@; chmod 755 $@
82.else
83STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d'
84.endif
85
86##
87## (6) port specific target dependencies
88##
89
90# depend on CPU configuration
91cpufunc.o cpufunc_asm.o: Makefile
92
93# depend on DIAGNOSTIC etc.
94cpuswitch.o fault.o machdep.o: Makefile
95
96# various assembly files that depend on assym.h
97atomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h
98exception.o fiq_subr.o fusu.o irq_dispatch.o isa_irq.o sigcode.o: assym.h
99spl.o vectors.o: assym.h
100
101##
102## (7) misc settings
103##
104
105##
106## (8) config(8) generated machinery
107##
108%INCLUDES
109
110%OBJS
111
112%CFILES
113
114%SFILES
115
116%LOAD
117
118%RULES
119
120##
121## (9) after the config file is inserted
122##
123
124.for f in ${SFILES:T:Mcpufunc_asm*}
125AFLAGS.${f}+=-marm
126.endfor
127
128##
129## (10) port independent kernel machinery
130##
131
132.include "$S/conf/Makefile.kern.inc"
133
134##
135## (11) Appending make options.
136##
137%MAKEOPTIONSAPPEND
138