Import 2.4.0-test5pre3
[davej-history.git] / arch / arm / Makefile
blob5bd7af915dd8eb3a46b9961a9027c2698c13e2ca
2 # arch/arm/Makefile
4 # This file is included by the global makefile so that you can add your own
5 # architecture-specific flags and dependencies. Remember to do have actions
6 # for "archclean" and "archdep" for cleaning up and making dependencies for
7 # this architecture
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License. See the file "COPYING" in the main directory of this archive
11 # for more details.
13 # Copyright (C) 1995-1999 by Russell King
15 OBJCOPY := $(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
16 CPP := $(CC) -E
17 LINKFLAGS := -p -X -T arch/arm/vmlinux.lds
18 ARCHCC := $(word 1,$(CC))
20 AFLAGS += -mno-fpu
21 CFLAGS_PIPE := -pipe
22 CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) -msoft-float
24 ifdef CONFIG_FRAME_POINTER
25 CFLAGS := $(CFLAGS:-fomit-frame-pointer=)
26 endif
28 ifdef CONFIG_DEBUG_INFO
29 CFLAGS += -g
30 endif
32 GZFLAGS = -9
34 # Ensure this is ld "2.9.4" or later
35 NEW_LINKER := $(shell if $(LD) --gc-sections --version >/dev/null 2>&1; then echo y; else echo n; fi)
37 ifneq ($(NEW_LINKER),y)
38 dummy:; @echo '*** ${VERSION}.${PATCHLEVEL} kernels no longer build correctly with old versions of binutils.'
39 @echo '*** Please upgrade your binutils to 2.9.5.'
40 @false
41 endif
43 # GCC 2.7 uses different options to later compilers; sort out which we have
44 NEW_GCC := $(shell if $(CC) --version 2>&1 | grep '^2\.7' > /dev/null; then echo n; else echo y; fi)
47 # select flags depending on the compiler
49 ifeq ($(NEW_GCC),y)
50 CFLAGS += -mshort-load-bytes
51 CFLAGS_PROC_CPU_26 := -mcpu=arm3 -Os
52 CFLAGS_PROC_CPU_32v3 := -march=armv3
53 CFLAGS_PROC_CPU_32v4 := -march=armv4
54 CFLAGS_ARM6 := -mtune=arm6
55 CFLAGS_ARM7 := -mtune=arm7
56 CFLAGS_ARM720 := -mtune=arm7tdmi
57 CFLAGS_SA110 := -mtune=strongarm110
58 else
59 CFLAGS += -DNO_TEXT_SECTIONS
60 CFLAGS_PROC_CPU_26 := -m3
61 CFLAGS_PROC_CPU_32v3 :=
62 CFLAGS_PROC_CPU_32v4 :=
63 CFLAGS_ARM6 := -m6
64 CFLAGS_ARM7 := -m6
65 CFLAGS_ARM720 := -m6
66 CFLAGS_SA110 := -m6
67 endif
70 # Select CPU dependent flags
72 ifeq ($(CONFIG_CPU_26),y)
73 PROCESSOR = armo
74 TEXTADDR = 0x02080000
75 CFLAGS += $(CFLAGS_PROC_CPU_26)
76 AFLAGS += -mapcs-26
77 endif
79 ifeq ($(CONFIG_CPU_32),y)
80 PROCESSOR = armv
81 TEXTADDR = 0xC0008000
82 ifeq ($(CONFIG_CPU_32v4),y)
83 CFLAGS += $(CFLAGS_PROC_CPU_32v4)
84 AFLAGS += -mapcs-32 -marmv4
85 else
86 CFLAGS += $(CFLAGS_PROC_CPU_32v3)
87 AFLAGS += -mapcs-32 -marmv3m
88 endif
90 # Exactly one of the following must be selected
92 ifeq ($(CONFIG_CPU_ARM6),y)
93 CFLAGS += $(CFLAGS_ARM6)
94 else
95 ifeq ($(CONFIG_CPU_ARM7),y)
96 CFLAGS += $(CFLAGS_ARM7)
97 else
98 ifeq ($(CONFIG_CPU_ARM720),y)
99 CFLAGS += $(CFLAGS_ARM720)
100 else
101 ifeq ($(CONFIG_CPU_SA110),y)
102 CFLAGS += $(CFLAGS_SA110)
103 else
104 ifeq ($(CONFIG_CPU_SA1100),y)
105 CFLAGS += $(CFLAGS_SA110)
106 endif
107 endif
108 endif
109 endif
110 endif
111 endif
113 LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
115 export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
117 ifeq ($(CONFIG_ARCH_ARCA5K),y)
118 MACHINE = arc
119 ARCHDIR = arc
120 endif
122 ifeq ($(CONFIG_ARCH_RPC),y)
123 MACHINE = rpc
124 ARCHDIR = rpc
125 endif
127 ifeq ($(CONFIG_ARCH_EBSA110),y)
128 MACHINE = ebsa110
129 ARCHDIR = ebsa110
130 endif
132 ifeq ($(CONFIG_ARCH_CLPS7500),y)
133 MACHINE = clps7500
134 ARCHDIR = cl7500
135 endif
137 ifeq ($(CONFIG_FOOTBRIDGE),y)
138 MACHINE = footbridge
139 ARCHDIR = ebsa285
140 endif
142 ifeq ($(CONFIG_ARCH_CO285),y)
143 TEXTADDR = 0x60008000
144 endif
146 ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
147 MACHINE = nexuspci
148 ARCHDIR = nexuspci
149 endif
151 ifeq ($(CONFIG_ARCH_SHARK),y)
152 MACHINE = shark
153 ARCHDIR = shark
154 endif
156 ifeq ($(CONFIG_ARCH_SA1100),y)
157 MACHINE = sa1100
158 ARCHDIR = sa1100
159 endif
161 ifeq ($(CONFIG_ARCH_L7200),y)
162 MACHINE = l7200
163 ARCHDIR = l7200
164 endif
166 HEAD := arch/arm/kernel/head-$(PROCESSOR).o \
167 arch/arm/kernel/init_task.o
168 SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib \
169 arch/arm/special arch/arm/nwfpe
170 CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
171 LIBS := arch/arm/lib/lib.o arch/arm/lib/lib.a $(LIBS) $(LIBGCC)
172 DRIVERS += arch/arm/special/special.a
174 ifeq ($(CONFIG_NWFPE),y)
175 LIBS := arch/arm/nwfpe/math-emu.o $(LIBS)
176 endif
178 ifeq ($(CONFIG_ARCH_ACORN),y)
179 SUBDIRS += drivers/acorn
180 DRIVERS += drivers/acorn/block/acorn-block.a
181 DRIVERS += drivers/acorn/char/acorn-char.o
182 DRIVERS += drivers/acorn/net/acorn-net.o
183 DRIVERS += drivers/acorn/scsi/acorn-scsi.a
184 endif
186 ifeq ($(CONFIG_ARCH_CLPS7500),y)
187 SUBDIRS += drivers/acorn/char
188 DRIVERS += drivers/acorn/char/acorn-char.o
189 endif
191 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
193 # The following is a hack to get 'constants.h' up
194 # to date before starting compilation
196 $(patsubst %, _dir_%, $(SUBDIRS)) : constants
198 constants: $(TOPDIR)/include/asm-arm/proc-fns.h dummy
199 @$(MAKE) -C arch/arm/lib constants.h
201 symlinks: archsymlinks
203 archsymlinks:
204 $(RM) include/asm-arm/arch include/asm-arm/proc
205 (cd include/asm-arm; ln -sf arch-$(ARCHDIR) arch; ln -sf proc-$(PROCESSOR) proc)
207 vmlinux: arch/arm/vmlinux.lds
209 arch/arm/vmlinux.lds: arch/arm/vmlinux-$(PROCESSOR).lds.in dummy
210 @sed 's/TEXTADDR/$(TEXTADDR)/' <$< >$@
212 arch/arm/kernel: dummy
213 $(MAKE) linuxsubdirs SUBDIRS=arch/arm/kernel
215 arch/arm/mm: dummy
216 $(MAKE) linuxsubdirs SUBDIRS=arch/arm/mm
218 arch/arm/lib: dummy
219 $(MAKE) linuxsubdirs SUBDIRS=arch/arm/lib
221 zImage zinstall Image install: vmlinux
222 @$(MAKEBOOT) $@
224 archmrproper:
225 @$(MAKE) -C arch/$(ARCH)/special mrproper
226 $(RM) include/asm-arm/arch include/asm-arm/proc
228 archclean:
229 @$(MAKEBOOT) clean
230 $(RM) arch/arm/lib/constants.h arch/arm/vmlinux.lds
232 archdep: symlinks
233 @$(MAKEBOOT) dep
235 # My testing targets (that short circuit a few dependencies)
236 zImg:; @$(MAKEBOOT) zImage
237 Img:; @$(MAKEBOOT) Image
238 i:; @$(MAKEBOOT) install
239 zi:; @$(MAKEBOOT) zinstall
242 # Configuration targets. Use these to select a
243 # configuration for your architecture
245 a5k_config:
246 $(RM) arch/arm/defconfig
247 cp arch/arm/def-configs/a5k arch/arm/defconfig
249 ebsa110_config:
250 $(RM) arch/arm/defconfig
251 cp arch/arm/def-configs/ebsa110 arch/arm/defconfig
253 footbridge_config:
254 $(RM) arch/arm/defconfig
255 cp arch/arm/def-configs/footbridge arch/arm/defconfig
257 rpc_config:
258 $(RM) arch/arm/defconfig
259 cp arch/arm/def-configs/rpc arch/arm/defconfig
261 brutus_config:
262 $(RM) arch/arm/defconfig
263 cp arch/arm/def-configs/brutus arch/arm/defconfig
265 victor_config:
266 $(RM) arch/arm/defconfig
267 cp arch/arm/def-configs/victor arch/arm/defconfig
269 empeg_config:
270 $(RM) arch/arm/defconfig
271 cp arch/arm/def-configs/empeg arch/arm/defconfig
273 thinclient_config:
274 $(RM) arch/arm/defconfig
275 cp arch/arm/def-configs/thinclient arch/arm/defconfig
277 assabet_config:
278 $(RM) arch/arm/defconfig
279 cp arch/arm/def-configs/assabet arch/arm/defconfig
281 lart_config:
282 $(RM) arch/arm/defconfig
283 cp arch/arm/def-configs/lart arch/arm/defconfig
285 l7200_config:
286 $(RM) arch/arm/defconfig
287 cp arch/arm/def-configs/lusl7200 arch/arm/defconfig