xref: /netbsd-src/sys/arch/arm/conf/Makefile.arm (revision af56d1fe9956bd7c616e18c1b7f025f464618471)
1#	$NetBSD: Makefile.arm,v 1.37 2013/02/03 11:36:55 skrll 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
38CFLAGS+=	 -mfloat-abi=soft
39
40##
41## (3) libkern and compat
42##
43KERN_AS=	obj
44
45##
46## (4) local objects, compile rules, and dependencies
47##
48MD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
49MD_CFILES+=
50MD_SFILES+=	${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S
51
52.if defined(SYSTEM_FIRST_OBJ)
53${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
54	${NORMAL_S}
55.endif
56
57locore.o: ${ARM}/arm32/locore.S assym.h
58	${NORMAL_S}
59
60##
61## (5) link settings
62##
63LOADADDRESS?=	0xF0000000
64LINKFLAGS_NORMAL=	-X
65# Strip ARM mapping symbols from the kernel image, as they interfere
66# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
67.if !defined(DEBUG) || empty(DEBUG:M-g*)
68SYSTEM_LD_TAIL?=	${SYSTEM_LD_TAIL_DBSYM} ; \
69			${OBJCOPY} --strip-symbol='$$a'	 \
70				    --strip-symbol='$$t'	 \
71				    --strip-symbol='$$d' $@	;\
72			${SIZE} $@; chmod 755 $@
73.else
74STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d'
75.endif
76
77##
78## (6) port specific target dependencies
79##
80
81# depend on CPU configuration
82cpufunc.o cpufunc_asm.o: Makefile
83
84# depend on DIAGNOSTIC etc.
85cpuswitch.o fault.o machdep.o: Makefile
86
87# various assembly files that depend on assym.h
88atomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o cpu_in_cksum.o: assym.h
89exception.o fiq_subr.o fusu.o irq_dispatch.o isa_irq.o sigcode.o: assym.h
90spl.o vectors.o: assym.h
91
92##
93## (7) misc settings
94##
95
96##
97## (8) config(8) generated machinery
98##
99%INCLUDES
100
101%OBJS
102
103%CFILES
104
105%SFILES
106
107%LOAD
108
109%RULES
110
111##
112## (9) port independent kernel machinery
113##
114.include "$S/conf/Makefile.kern.inc"
115
116##
117## (10) Appending make options.
118##
119%MAKEOPTIONSAPPEND
120