- Linus: drop support for old-style Makefiles entirely. Big.
[davej-history.git] / arch / arm / Makefile
blobc19ccddec4ea529bfeba067bfc29359b43f3dbb3
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-2000 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 $(LD) --gc-sections --version >/dev/null 2>&1; echo $$?)
37 ifneq ($(NEW_LINKER),0)
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 $(CC) --version 2>&1 | grep '^2\.7' > /dev/null; echo $$?)
47 # select flags depending on the compiler
49 ifneq ($(NEW_GCC),0)
50 CFLAGS += -mshort-load-bytes
51 CFLAGS_PROC_CPU_26 := -mcpu=arm3 -mapcs-26 -Os
52 CFLAGS_PROC_CPU_32v3 := -march=armv3
53 CFLAGS_PROC_CPU_32v4 := -march=armv4
54 else
55 CFLAGS += -DNO_TEXT_SECTIONS
56 CFLAGS_PROC_CPU_26 := -m3
57 CFLAGS_PROC_CPU_32v3 := -m6
58 CFLAGS_PROC_CPU_32v4 := -m6
59 endif
62 # Select CPU dependent flags
64 ifeq ($(CONFIG_CPU_26),y)
65 PROCESSOR = armo
66 TEXTADDR = 0x02080000
67 CFLAGS += $(CFLAGS_PROC_CPU_26)
68 AFLAGS += -mapcs-26
69 endif
71 ifeq ($(CONFIG_CPU_32),y)
72 PROCESSOR = armv
73 TEXTADDR = 0xC0008000
74 ifeq ($(CONFIG_CPU_32v4),y)
75 CFLAGS += $(CFLAGS_PROC_CPU_32v4)
76 AFLAGS += -mapcs-32 -marmv4
77 else
78 CFLAGS += $(CFLAGS_PROC_CPU_32v3)
79 AFLAGS += -mapcs-32 -marmv3m
80 endif
82 opt-$(CONFIG_CPU_ARM6) := -mtune=arm6
83 opt-$(CONFIG_CPU_ARM7) := -mtune=arm7
84 opt-$(CONFIG_CPU_ARM720) := -mtune=arm7tdmi
85 opt-$(CONFIG_CPU_ARM920) := -mtune=arm9tdmi
86 opt-$(CONFIG_CPU_SA110) := -mtune=strongarm110
87 opt-$(CONFIG_CPU_SA1100) := -mtune=strongarm110
89 ifneq ($(NEW_GCC),0)
90 CFLAGS += $(opt-y)
91 endif
92 endif
94 LIBGCC := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
96 export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
98 ifeq ($(CONFIG_ARCH_ARCA5K),y)
99 MACHINE = arc
100 endif
102 ifeq ($(CONFIG_ARCH_RPC),y)
103 MACHINE = rpc
104 endif
106 ifeq ($(CONFIG_ARCH_EBSA110),y)
107 MACHINE = ebsa110
108 endif
110 ifeq ($(CONFIG_ARCH_CLPS7500),y)
111 MACHINE = clps7500
112 INCDIR = cl7500
113 endif
115 ifeq ($(CONFIG_FOOTBRIDGE),y)
116 MACHINE = footbridge
117 INCDIR = ebsa285
118 endif
120 ifeq ($(CONFIG_ARCH_CO285),y)
121 TEXTADDR = 0x60008000
122 MACHINE = footbridge
123 INCDIR = ebsa285
124 endif
126 ifeq ($(CONFIG_ARCH_NEXUSPCI),y)
127 MACHINE = nexuspci
128 endif
130 ifeq ($(CONFIG_ARCH_SHARK),y)
131 MACHINE = shark
132 endif
134 ifeq ($(CONFIG_ARCH_SA1100),y)
135 MACHINE = sa1100
136 endif
138 ifeq ($(CONFIG_ARCH_L7200),y)
139 MACHINE = l7200
140 endif
142 ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
143 MACHINE = integrator
144 endif
146 # Only set INCDIR if its not already defined above
147 # Grr, ?= doesn't work as all the other assignment operators do. Make bug?
148 ifeq ($(origin INCDIR), undefined)
149 INCDIR := $(MACHINE)
150 endif
152 # If we have a machine-specific directory, then include it in the build.
153 MACHDIR := arch/arm/mach-$(MACHINE)
154 ifeq ($(MACHDIR),$(wildcard $(MACHDIR)))
155 SUBDIRS += $(MACHDIR)
156 CORE_FILES := $(MACHDIR)/$(MACHINE).o $(CORE_FILES)
157 endif
159 HEAD := arch/arm/kernel/head-$(PROCESSOR).o \
160 arch/arm/kernel/init_task.o
161 SUBDIRS += arch/arm/kernel arch/arm/mm arch/arm/lib \
162 arch/arm/nwfpe
163 CORE_FILES := arch/arm/kernel/kernel.o arch/arm/mm/mm.o $(CORE_FILES)
164 LIBS := arch/arm/lib/lib.o arch/arm/lib/lib.a $(LIBS) $(LIBGCC)
166 ifeq ($(CONFIG_NWFPE),y)
167 LIBS := arch/arm/nwfpe/math-emu.o $(LIBS)
168 endif
170 ifeq ($(CONFIG_ARCH_ACORN),y)
171 SUBDIRS += drivers/acorn
172 DRIVERS += drivers/acorn/block/acorn-block.a
173 DRIVERS += drivers/acorn/char/acorn-char.o
174 DRIVERS += drivers/acorn/net/acorn-net.o
175 DRIVERS += drivers/acorn/scsi/acorn-scsi.a
176 endif
178 ifeq ($(CONFIG_ARCH_CLPS7500),y)
179 SUBDIRS += drivers/acorn/char
180 DRIVERS += drivers/acorn/char/acorn-char.o
181 endif
183 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
185 # The following is a hack to get 'constants.h' up
186 # to date before starting compilation
188 $(patsubst %, _dir_%, $(SUBDIRS)) init/main.o init/version.o : \
189 include/asm-arm/mach-types.h
191 $(patsubst %, _dir_%, $(SUBDIRS)) : constants
193 include/asm-arm/mach-types.h: arch/arm/tools/mach-types \
194 arch/arm/tools/gen-mach-types
195 @awk -f arch/arm/tools/gen-mach-types arch/arm/tools/mach-types > $@
197 constants: dummy
198 @$(MAKE) -C arch/arm/lib constants.h
200 symlinks: archsymlinks
202 archsymlinks:
203 $(RM) include/asm-arm/arch include/asm-arm/proc
204 (cd include/asm-arm; ln -sf arch-$(INCDIR) arch; ln -sf proc-$(PROCESSOR) proc)
206 vmlinux: arch/arm/vmlinux.lds
208 arch/arm/vmlinux.lds: arch/arm/vmlinux-$(PROCESSOR).lds.in dummy
209 @sed 's/TEXTADDR/$(TEXTADDR)/' <$< >$@
211 arch/arm/kernel arch/arm/mm arch/arm/lib: dummy
212 $(MAKE) CFLAGS="$(CFLAGS) $(CFLAGS_KERNEL)" $(subst $@, _dir_$@, $@)
214 bzImage zImage zinstall Image bootpImage install: vmlinux
215 @$(MAKEBOOT) $@
217 archmrproper:
218 $(RM) include/asm-arm/arch include/asm-arm/proc
220 archclean:
221 @$(MAKEBOOT) clean
222 $(RM) arch/arm/lib/constants.h arch/arm/vmlinux.lds
223 $(RM) include/asm-arm/mach-types.h
225 archdep: archsymlinks
226 @$(MAKEBOOT) dep
228 # My testing targets (that short circuit a few dependencies)
229 zImg:; @$(MAKEBOOT) zImage
230 Img:; @$(MAKEBOOT) Image
231 i:; @$(MAKEBOOT) install
232 zi:; @$(MAKEBOOT) zinstall
235 # Configuration targets. Use these to select a
236 # configuration for your architecture
237 CFGS= a5k_config ebsa110_config \
238 footbridge_config rpc_config \
239 brutus_config victor_config \
240 empeg_config thinclient_config \
241 assabet_config lart_config \
242 cerf_config lusl7200_config
244 $(CFGS):
245 @( \
246 CFG=$(@:_config=); \
247 if [ -f arch/arm/def-configs/$$CFG ]; then \
248 $(RM) arch/arm/defconfig; \
249 cp arch/arm/def-configs/$$CFG arch/arm/defconfig; \
250 echo "*** Default configuration for $$CFG installed"; \
251 echo "*** Next, you may run 'make oldconfig'"; \
252 else \
253 echo "$$CFG does not exist"; \
254 fi; \