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
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
13 # Copyright (C) 1995-2000 by Russell King
15 OBJCOPY
:= $(CROSS_COMPILE
)objcopy
-O binary
-R .note
-R .comment
-S
17 LINKFLAGS
:= -p
-X
-T arch
/arm
/vmlinux.lds
18 ARCHCC
:= $(word 1,$(CC
))
22 CFLAGS
:= $(CFLAGS
) $(CFLAGS_PIPE
) -msoft-float
24 ifdef CONFIG_FRAME_POINTER
25 CFLAGS
:= $(CFLAGS
:-fomit-frame-pointer
=)
28 ifdef CONFIG_DEBUG_INFO
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.'
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
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
55 CFLAGS
+= -DNO_TEXT_SECTIONS
56 CFLAGS_PROC_CPU_26
:= -m3
57 CFLAGS_PROC_CPU_32v3
:= -m6
58 CFLAGS_PROC_CPU_32v4
:= -m6
62 # Select CPU dependent flags
64 ifeq ($(CONFIG_CPU_26
),y
)
67 CFLAGS
+= $(CFLAGS_PROC_CPU_26
)
71 ifeq ($(CONFIG_CPU_32
),y
)
74 ifeq ($(CONFIG_CPU_32v4
),y
)
75 CFLAGS
+= $(CFLAGS_PROC_CPU_32v4
)
76 AFLAGS
+= -mapcs-32
-marmv4
78 CFLAGS
+= $(CFLAGS_PROC_CPU_32v3
)
79 AFLAGS
+= -mapcs-32
-marmv3m
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
94 LIBGCC
:= $(shell $(CC
) $(CFLAGS
) --print-libgcc-file-name
)
96 export LIBGCC MACHINE PROCESSOR TEXTADDR GZFLAGS
98 ifeq ($(CONFIG_ARCH_ARCA5K
),y
)
102 ifeq ($(CONFIG_ARCH_RPC
),y
)
106 ifeq ($(CONFIG_ARCH_EBSA110
),y
)
110 ifeq ($(CONFIG_ARCH_CLPS7500
),y
)
115 ifeq ($(CONFIG_FOOTBRIDGE
),y
)
120 ifeq ($(CONFIG_ARCH_CO285
),y
)
121 TEXTADDR
= 0x60008000
126 ifeq ($(CONFIG_ARCH_NEXUSPCI
),y
)
130 ifeq ($(CONFIG_ARCH_SHARK
),y
)
134 ifeq ($(CONFIG_ARCH_SA1100
),y
)
138 ifeq ($(CONFIG_ARCH_L7200
),y
)
142 ifeq ($(CONFIG_ARCH_INTEGRATOR
),y
)
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
)
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
)
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 \
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
)
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
178 ifeq ($(CONFIG_ARCH_CLPS7500
),y
)
179 SUBDIRS
+= drivers
/acorn
/char
180 DRIVERS
+= drivers
/acorn
/char
/acorn-char.o
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
> $@
198 @
$(MAKE
) -C arch
/arm
/lib constants.h
200 symlinks
: 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
218 $(RM
) include/asm-arm
/arch
include/asm-arm
/proc
222 $(RM
) arch
/arm
/lib
/constants.h arch
/arm
/vmlinux.lds
223 $(RM
) include/asm-arm
/mach-types.h
225 archdep
: archsymlinks
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
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'"; \
253 echo
"$$CFG does not exist"; \