make oldconfig will rebuild these...
[linux-2.4.21-pre4.git] / arch / arm / Makefile
1 #
2 # arch/arm/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8 # Copyright (C) 1995-2001 by Russell King
9
10 LINKFLAGS       :=-p -X -T arch/arm/vmlinux.lds
11 GZFLAGS         :=-9
12 CFLAGS          +=-fno-common -pipe
13
14 ifeq ($(CONFIG_DEBUG_INFO),y)
15 CFLAGS          +=-g
16 endif
17
18 # Select CPU dependent flags.  Note that order of declaration is important;
19 # the options further down the list override previous items.
20 #
21 # Note!  For APCS-26 YOU MUST HAVE AN APCS-26 LIBGCC.A
22 #
23 apcs-y                          :=-mapcs-32
24 apcs-$(CONFIG_CPU_26)           :=-mapcs-26 -mcpu=arm3 -Os
25
26 # This selects which instruction set is used.
27 arch-y                          :=
28 arch-$(CONFIG_CPU_32v3)         :=-march=armv3
29 arch-$(CONFIG_CPU_32v4)         :=-march=armv4
30 arch-$(CONFIG_CPU_32v5)         :=-march=armv5
31
32 # This selects how we optimise for the processor.
33 tune-y                          :=
34 tune-$(CONFIG_CPU_ARM610)       :=-mtune=arm610
35 tune-$(CONFIG_CPU_ARM710)       :=-mtune=arm710
36 tune-$(CONFIG_CPU_ARM720T)      :=-mtune=arm7tdmi
37 tune-$(CONFIG_CPU_ARM920T)      :=-mtune=arm9tdmi
38 tune-$(CONFIG_CPU_ARM922T)      :=-mtune=arm9tdmi
39 tune-$(CONFIG_CPU_ARM926T)      :=-mtune=arm9tdmi
40 tune-$(CONFIG_CPU_SA110)        :=-mtune=strongarm110
41 tune-$(CONFIG_CPU_SA1100)       :=-mtune=strongarm1100
42
43 CFLAGS_BOOT     :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float
44 CFLAGS          +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float
45 AFLAGS          +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float
46
47 ifeq ($(CONFIG_CPU_26),y)
48 PROCESSOR        = armo
49   ifeq ($(CONFIG_ROM_KERNEL),y)
50     DATAADDR     = 0x02080000
51     TEXTADDR     = 0x03800000
52     LDSCRIPT     = arch/arm/vmlinux-armo-rom.lds.in
53   else
54     TEXTADDR     = 0x02080000
55     LDSCRIPT     = arch/arm/vmlinux-armo.lds.in
56   endif
57 endif
58
59 ifeq ($(CONFIG_CPU_32),y)
60 PROCESSOR        = armv
61 TEXTADDR         = 0xC0008000
62 LDSCRIPT         = arch/arm/vmlinux-armv.lds.in
63 endif
64
65 ifeq ($(CONFIG_ARCH_ARCA5K),y)
66 MACHINE          = arc
67 endif
68
69 ifeq ($(CONFIG_ARCH_RPC),y)
70 MACHINE          = rpc
71 endif
72
73 ifeq ($(CONFIG_ARCH_EBSA110),y)
74 MACHINE          = ebsa110
75 CFLAGS_3c589_cs :=-DISA_SIXTEEN_BIT_PERIPHERAL
76 export CFLAGS_3c589_cs
77 endif
78
79 ifeq ($(CONFIG_ARCH_CLPS7500),y)
80 MACHINE          = clps7500
81 INCDIR           = cl7500
82 endif
83
84 ifeq ($(CONFIG_FOOTBRIDGE),y)
85 MACHINE          = footbridge
86 INCDIR           = ebsa285
87 endif
88
89 ifeq ($(CONFIG_ARCH_CO285),y)
90 TEXTADDR         = 0x60008000
91 MACHINE          = footbridge
92 INCDIR           = ebsa285
93 endif
94
95 ifeq ($(CONFIG_ARCH_FTVPCI),y)
96 MACHINE          = ftvpci
97 INCDIR           = nexuspci
98 endif
99
100 ifeq ($(CONFIG_ARCH_TBOX),y)
101 MACHINE          = tbox
102 endif
103
104 ifeq ($(CONFIG_ARCH_SHARK),y)
105 MACHINE          = shark
106 endif
107
108 ifeq ($(CONFIG_ARCH_SA1100),y)
109 ifeq ($(CONFIG_SA1111),y)
110 # SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
111 TEXTADDR         = 0xc0208000
112 endif
113 MACHINE          = sa1100
114 endif
115
116 ifeq ($(CONFIG_ARCH_L7200),y)
117 MACHINE          = l7200
118 endif
119
120 ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
121 MACHINE          = integrator
122 endif
123
124 ifeq ($(CONFIG_ARCH_MX1ADS),y)
125 MACHINE          = mx1ads
126 endif
127
128 ifeq ($(CONFIG_ARCH_CAMELOT),y)
129 MACHINE          = epxa10db
130 endif
131
132 ifeq ($(CONFIG_ARCH_CLPS711X),y)
133 TEXTADDR         = 0xc0028000
134 MACHINE          = clps711x
135 endif
136
137 ifeq ($(CONFIG_ARCH_FORTUNET),y)
138 TEXTADDR         = 0xc0008000
139 endif
140
141 ifeq ($(CONFIG_ARCH_ANAKIN),y)
142 MACHINE          = anakin
143 endif
144
145 export  MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT
146
147 # Only set INCDIR if its not already defined above
148 # Grr, ?= doesn't work as all the other assignment operators do.  Make bug?
149 ifeq ($(origin INCDIR), undefined)
150 INCDIR          := $(MACHINE)
151 endif
152
153 ifeq ($(origin DATAADDR), undefined)
154 DATAADDR        := .
155 endif
156
157 # If we have a machine-specific directory, then include it in the build.
158 MACHDIR         := arch/arm/mach-$(MACHINE)
159 ifeq ($(MACHDIR),$(wildcard $(MACHDIR)))
160 SUBDIRS         += $(MACHDIR)
161 CORE_FILES      := $(MACHDIR)/$(MACHINE).o $(CORE_FILES)
162 endif
163
164 HEAD            := arch/arm/kernel/head-$(PROCESSOR).o \
165                    arch/arm/kernel/init_task.o
166 SUBDIRS         += arch/arm/kernel arch/arm/mm arch/arm/lib arch/arm/nwfpe
167 CORE_FILES      := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
168 LIBS            := arch/arm/lib/lib.a $(LIBS)
169
170 ifeq ($(CONFIG_FPE_NWFPE),y)
171 LIBS            := arch/arm/nwfpe/math-emu.o $(LIBS)
172 endif
173
174 # Only include fastfpe if it is part of the kernel tree.
175 FASTFPE         := arch/arm/fastfpe
176 ifeq ($(FASTFPE),$(wildcard $(FASTFPE)))
177 SUBDIRS         += $(FASTFPE)
178 ifeq ($(CONFIG_FPE_FASTFPE),y)
179 LIBS            := arch/arm/fastfpe/fast-math-emu.o $(LIBS)
180 endif
181 endif
182
183 ifeq ($(findstring y,$(CONFIG_ARCH_CLPS7500) $(CONFIG_ARCH_L7200)),y)
184 SUBDIRS         += drivers/acorn/char
185 DRIVERS         += drivers/acorn/char/acorn-char.o
186 endif
187
188 MAKEBOOT         = $(MAKE) -C arch/$(ARCH)/boot
189 MAKETOOLS        = $(MAKE) -C arch/$(ARCH)/tools
190
191 # The following is a hack to get 'constants.h' up
192 # to date before starting compilation
193
194 $(patsubst %,_dir_%, $(SUBDIRS)): maketools
195 $(patsubst %,_modsubdir_%,$(MOD_DIRS)): maketools
196
197 symlinks: archsymlinks
198
199 archsymlinks:
200         $(RM) include/asm-arm/arch include/asm-arm/proc
201         (cd include/asm-arm; ln -sf arch-$(INCDIR) arch; ln -sf proc-$(PROCESSOR) proc)
202
203 vmlinux: arch/arm/vmlinux.lds
204
205 arch/arm/vmlinux.lds: $(LDSCRIPT) dummy
206         @sed 's/TEXTADDR/$(TEXTADDR)/;s/DATAADDR/$(DATAADDR)/' $(LDSCRIPT) >$@
207
208 arch/arm/kernel arch/arm/mm arch/arm/lib: dummy
209         $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
210
211 bzImage zImage zinstall Image bootpImage install: vmlinux
212         @$(MAKEBOOT) $@
213
214 CLEAN_FILES     += \
215         arch/arm/vmlinux.lds
216
217 MRPROPER_FILES  += \
218         arch/arm/tools/constants.h* \
219         include/asm-arm/arch \
220         include/asm-arm/proc \
221         include/asm-arm/constants.h* \
222         include/asm-arm/mach-types.h
223
224 # We use MRPROPER_FILES and CLEAN_FILES now
225 archmrproper:
226         @/bin/true
227
228 archclean:
229         @$(MAKEBOOT) clean
230
231 archdep: scripts/mkdep archsymlinks
232         @$(MAKETOOLS) dep
233         @$(MAKEBOOT) dep
234
235 # we need version.h
236 maketools: checkbin include/linux/version.h
237         @$(MAKETOOLS) all
238
239 # Ensure this is ld "2.9.4" or later
240 NEW_LINKER      := $(shell $(LD) --gc-sections --version >/dev/null 2>&1; echo $$?)
241
242 ifneq ($(NEW_LINKER),0)
243 checkbin:
244         @echo '*** ${VERSION}.${PATCHLEVEL} kernels no longer build correctly with old versions of binutils.'
245         @echo '*** Please upgrade your binutils to 2.9.5.'
246         @false
247 else
248 checkbin:
249         @true
250 endif
251
252 # My testing targets (that short circuit a few dependencies)
253 zImg:;  @$(MAKEBOOT) zImage
254 Img:;   @$(MAKEBOOT) Image
255 i:;     @$(MAKEBOOT) install
256 zi:;    @$(MAKEBOOT) zinstall
257 bp:;    @$(MAKEBOOT) bootpImage
258
259 #
260 # Configuration targets.  Use these to select a
261 # configuration for your architecture
262 %_config:
263         @( \
264         CFG=$(@:_config=); \
265         if [ -f arch/arm/def-configs/$$CFG ]; then \
266           [ -f .config ] && mv -f .config .config.old; \
267           cp arch/arm/def-configs/$$CFG .config; \
268           echo "*** Default configuration for $$CFG installed"; \
269           echo "*** Next, you may run 'make oldconfig'"; \
270         else \
271           echo "$$CFG does not exist"; \
272         fi; \
273         )