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
8 # Copyright (C) 1995-2001 by Russell King
10 LINKFLAGS :=-p -X -T arch/arm/vmlinux.lds
12 CFLAGS +=-fno-common -pipe
14 ifeq ($(CONFIG_DEBUG_INFO),y)
18 # Select CPU dependent flags. Note that order of declaration is important;
19 # the options further down the list override previous items.
21 # Note! For APCS-26 YOU MUST HAVE AN APCS-26 LIBGCC.A
24 apcs-$(CONFIG_CPU_26) :=-mapcs-26 -mcpu=arm3 -Os
26 # This selects which instruction set is used.
28 arch-$(CONFIG_CPU_32v3) :=-march=armv3
29 arch-$(CONFIG_CPU_32v4) :=-march=armv4
30 arch-$(CONFIG_CPU_32v5) :=-march=armv5
32 # This selects how we optimise for the processor.
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
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
47 ifeq ($(CONFIG_CPU_26),y)
49 ifeq ($(CONFIG_ROM_KERNEL),y)
52 LDSCRIPT = arch/arm/vmlinux-armo-rom.lds.in
55 LDSCRIPT = arch/arm/vmlinux-armo.lds.in
59 ifeq ($(CONFIG_CPU_32),y)
62 LDSCRIPT = arch/arm/vmlinux-armv.lds.in
65 ifeq ($(CONFIG_ARCH_ARCA5K),y)
69 ifeq ($(CONFIG_ARCH_RPC),y)
73 ifeq ($(CONFIG_ARCH_EBSA110),y)
75 CFLAGS_3c589_cs :=-DISA_SIXTEEN_BIT_PERIPHERAL
76 export CFLAGS_3c589_cs
79 ifeq ($(CONFIG_ARCH_CLPS7500),y)
84 ifeq ($(CONFIG_FOOTBRIDGE),y)
89 ifeq ($(CONFIG_ARCH_CO285),y)
95 ifeq ($(CONFIG_ARCH_FTVPCI),y)
100 ifeq ($(CONFIG_ARCH_TBOX),y)
104 ifeq ($(CONFIG_ARCH_SHARK),y)
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
116 ifeq ($(CONFIG_ARCH_L7200),y)
120 ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
124 ifeq ($(CONFIG_ARCH_MX1ADS),y)
128 ifeq ($(CONFIG_ARCH_CAMELOT),y)
132 ifeq ($(CONFIG_ARCH_CLPS711X),y)
133 TEXTADDR = 0xc0028000
137 ifeq ($(CONFIG_ARCH_FORTUNET),y)
138 TEXTADDR = 0xc0008000
141 ifeq ($(CONFIG_ARCH_ANAKIN),y)
145 export MACHINE PROCESSOR TEXTADDR GZFLAGS CFLAGS_BOOT
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)
153 ifeq ($(origin DATAADDR), undefined)
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)
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)
170 ifeq ($(CONFIG_FPE_NWFPE),y)
171 LIBS := arch/arm/nwfpe/math-emu.o $(LIBS)
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)
183 ifeq ($(findstring y,$(CONFIG_ARCH_CLPS7500) $(CONFIG_ARCH_L7200)),y)
184 SUBDIRS += drivers/acorn/char
185 DRIVERS += drivers/acorn/char/acorn-char.o
188 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
189 MAKETOOLS = $(MAKE) -C arch/$(ARCH)/tools
191 # The following is a hack to get 'constants.h' up
192 # to date before starting compilation
194 $(patsubst %,_dir_%, $(SUBDIRS)): maketools
195 $(patsubst %,_modsubdir_%,$(MOD_DIRS)): maketools
197 symlinks: 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)
203 vmlinux: arch/arm/vmlinux.lds
205 arch/arm/vmlinux.lds: $(LDSCRIPT) dummy
206 @sed 's/TEXTADDR/$(TEXTADDR)/;s/DATAADDR/$(DATAADDR)/' $(LDSCRIPT) >$@
208 arch/arm/kernel arch/arm/mm arch/arm/lib: dummy
209 $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
211 bzImage zImage zinstall Image bootpImage install: vmlinux
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
224 # We use MRPROPER_FILES and CLEAN_FILES now
231 archdep: scripts/mkdep archsymlinks
236 maketools: checkbin include/linux/version.h
239 # Ensure this is ld "2.9.4" or later
240 NEW_LINKER := $(shell $(LD) --gc-sections --version >/dev/null 2>&1; echo $$?)
242 ifneq ($(NEW_LINKER),0)
244 @echo '*** ${VERSION}.${PATCHLEVEL} kernels no longer build correctly with old versions of binutils.'
245 @echo '*** Please upgrade your binutils to 2.9.5.'
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
260 # Configuration targets. Use these to select a
261 # configuration for your architecture
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'"; \
271 echo "$$CFG does not exist"; \