Makefile.arm revision 1.28
1#	$NetBSD: Makefile.arm,v 1.28 2006/12/10 10:01:49 scw 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
29ARM32=		$S/arch/arm32
30GENASSYM_CONF=	${ARM}/arm32/genassym.cf
31.-include "$S/arch/${MACHINE}/conf/Makefile.${MACHINE}.inc"
32
33##
34## (2) compile settings
35##
36# CPPFLAGS set by platform-specific Makefile fragment.
37AFLAGS+=	-x assembler-with-cpp
38
39##
40## (3) libkern and compat
41##
42KERN_AS=	obj
43
44##
45## (4) local objects, compile rules, and dependencies
46##
47MD_OBJS+=	${SYSTEM_FIRST_OBJ} locore.o
48MD_CFILES+=
49MD_SFILES+=	${SYSTEM_FIRST_SFILE} ${ARM}/arm32/locore.S
50
51.if defined(SYSTEM_FIRST_OBJ)
52${SYSTEM_FIRST_OBJ}: ${SYSTEM_FIRST_SFILE} assym.h
53	${NORMAL_S}
54.endif
55
56locore.o: ${ARM}/arm32/locore.S assym.h
57	${NORMAL_S}
58
59##
60## (5) link settings
61##
62LOADADDRESS?=	0xF0000000
63LINKFLAGS_NORMAL=	-X
64# Strip ARM mapping symbols from the kernel image, as they interfere
65# with ddb. Do it differently if 'makeoptions DEBUG="-g"' was specified.
66.if !defined(DEBUG) || empty(DEBUG:M-g*)
67SYSTEM_LD_TAIL?=	@${OBJCOPY} --strip-symbol='$$a'	 \
68				    --strip-symbol='$$t'	 \
69				    --strip-symbol='$$d' $@	;\
70			${SIZE} $@; chmod 755 $@
71.else
72STRIPFLAGS=-g --strip-symbol='$$a' --strip-symbol='$$t' --strip-symbol='$$d'
73.endif
74
75##
76## (6) port specific target dependencies
77##
78
79# depend on CPU configuration
80cpufunc.o cpufunc_asm.o: Makefile
81
82# depend on DIAGNOSTIC etc.
83cpuswitch.o fault.o machdep.o: Makefile
84
85# various assembly files that depend on assym.h
86atomic.o bcopy_page.o bcopyinout.o copystr.o cpuswitch.o exception.o: assym.h
87fiq_subr.o fusu.o in_cksum_arm.o irq_dispatch.o isa_irq.o sigcode.o: assym.h
88spl.o vectors.o: assym.h
89
90##
91## (7) misc settings
92##
93
94# XXX gcc 3.3 generates incorrect code without this
95# XXX see PR 23044
96COPTS.uipc_socket.c+=	-fno-strict-aliasing
97
98##
99## (8) config(8) generated machinery
100##
101%INCLUDES
102
103%OBJS
104
105%CFILES
106
107%SFILES
108
109%LOAD
110
111%RULES
112
113##
114## (9) port independent kernel machinery
115##
116.include "$S/conf/Makefile.kern.inc"
117
118##
119## (10) Appending make options.
120##
121%MAKEOPTIONSAPPEND
122