xref: /linux/arch/arm/Makefile (revision 312b62b6610cabea4cb535fd4889c41e9a84afca)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# arch/arm/Makefile
31da177e4SLinus Torvalds#
44f193362SPaul Smith# This file is included by the global makefile so that you can add your own
54f193362SPaul Smith# architecture-specific flags and dependencies.
64f193362SPaul Smith#
71da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public
81da177e4SLinus Torvalds# License.  See the file "COPYING" in the main directory of this archive
91da177e4SLinus Torvalds# for more details.
101da177e4SLinus Torvalds#
111da177e4SLinus Torvalds# Copyright (C) 1995-2001 by Russell King
121da177e4SLinus Torvalds
13091bb549SNathan ChancellorLDFLAGS_vmlinux	:= --no-undefined -X --pic-veneer
1426584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
1526584853SCatalin MarinasLDFLAGS_vmlinux	+= --be8
16336303aeSCao jinKBUILD_LDFLAGS_MODULE	+= --be8
1726584853SCatalin Marinasendif
1851b563fcSSam Ravnborg
197d485f64SArd Biesheuvelifeq ($(CONFIG_ARM_MODULE_PLTS),y)
2010df0638SMasahiro YamadaKBUILD_LDS_MODULE	+= $(srctree)/arch/arm/kernel/module.lds
217d485f64SArd Biesheuvelendif
227d485f64SArd Biesheuvel
231da177e4SLinus TorvaldsGZFLAGS		:=-9
24a0f97e06SSam Ravnborg#KBUILD_CFLAGS	+=-pipe
251da177e4SLinus Torvalds
26bd365591SMichal Marek# Never generate .eh_frame
27bd365591SMichal MarekKBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
28bd365591SMichal Marek
2932872c04SArnd Bergmann# This should work on most of the modern platforms
3032872c04SArnd BergmannKBUILD_DEFCONFIG := multi_v7_defconfig
311da177e4SLinus Torvalds
323dbda77eSUwe Kleine-Koenig# defines filename extension depending memory management type.
33f8c07de6SHyok S. Choiifeq ($(CONFIG_MMU),)
34f8c07de6SHyok S. ChoiMMUEXT		:= -nommu
35e91b36efSWill DeaconKBUILD_CFLAGS	+= $(call cc-option,-mno-unaligned-access)
36f8c07de6SHyok S. Choiendif
37f8c07de6SHyok S. Choi
381da177e4SLinus Torvaldsifeq ($(CONFIG_FRAME_POINTER),y)
396dc5fd93SNathan HuckleberryKBUILD_CFLAGS	+=-fno-omit-frame-pointer
406dc5fd93SNathan Huckleberryifeq ($(CONFIG_CC_IS_GCC),y)
416dc5fd93SNathan HuckleberryKBUILD_CFLAGS += -mapcs -mno-sched-prolog
426dc5fd93SNathan Huckleberryendif
431da177e4SLinus Torvaldsendif
441da177e4SLinus Torvalds
451da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
4606c5040cSSam RavnborgKBUILD_CPPFLAGS	+= -mbig-endian
47ff0c6eecSLuc Van OostenryckCHECKFLAGS	+= -D__ARMEB__
48d503ac53SMasahiro YamadaKBUILD_LDFLAGS	+= -EB
491da177e4SLinus Torvaldselse
5006c5040cSSam RavnborgKBUILD_CPPFLAGS	+= -mlittle-endian
51ff0c6eecSLuc Van OostenryckCHECKFLAGS	+= -D__ARMEL__
52d503ac53SMasahiro YamadaKBUILD_LDFLAGS	+= -EL
531da177e4SLinus Torvaldsendif
541da177e4SLinus Torvalds
55a077224fSArd Biesheuvel#
56a077224fSArd Biesheuvel# The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and
57a077224fSArd Biesheuvel# later may result in code being generated that handles signed short and signed
58a077224fSArd Biesheuvel# char struct members incorrectly. So disable it.
59a077224fSArd Biesheuvel# (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932)
60a077224fSArd Biesheuvel#
61a077224fSArd BiesheuvelKBUILD_CFLAGS	+= $(call cc-option,-fno-ipa-sra)
62a077224fSArd Biesheuvel
631da177e4SLinus Torvalds# This selects which instruction set is used.
641da177e4SLinus Torvalds# Note that GCC does not numerically define an architecture version
651da177e4SLinus Torvalds# macro, but instead defines a whole series of macros which makes
661da177e4SLinus Torvalds# testing for a specific architecture or later rather impossible.
673c0c01abSRussell Kingarch-$(CONFIG_CPU_32v7M)	=-D__LINUX_ARM_ARCH__=7 -march=armv7-m -Wa,-march=armv7-m
681b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v7)		=-D__LINUX_ARM_ARCH__=7 $(call cc-option,-march=armv7-a,-march=armv5t -Wa$(comma)-march=armv7-a)
691b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v6)		=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6,-march=armv5t -Wa$(comma)-march=armv6)
7023688e99SCatalin Marinas# Only override the compiler option if ARMv6. The ARMv6K extensions are
7123688e99SCatalin Marinas# always available in ARMv7
7223688e99SCatalin Marinasifeq ($(CONFIG_CPU_32v6),y)
731b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v6K)	=-D__LINUX_ARM_ARCH__=6 $(call cc-option,-march=armv6k,-march=armv5t -Wa$(comma)-march=armv6k)
7423688e99SCatalin Marinasendif
751b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v5)		=-D__LINUX_ARM_ARCH__=5 $(call cc-option,-march=armv5te,-march=armv4t)
761b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v4T)	=-D__LINUX_ARM_ARCH__=4 -march=armv4t
771b21376aSDouglas Andersonarch-$(CONFIG_CPU_32v4)		=-D__LINUX_ARM_ARCH__=4 -march=armv4
788403bcb7SJason A. Donenfeldarch-$(CONFIG_CPU_32v3)		=-D__LINUX_ARM_ARCH__=3 -march=armv3m
791b21376aSDouglas Anderson
801b21376aSDouglas Anderson# Evaluate arch cc-option calls now
811b21376aSDouglas Andersonarch-y := $(arch-y)
821da177e4SLinus Torvalds
831da177e4SLinus Torvalds# This selects how we optimise for the processor.
841b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM7TDMI)	=-mtune=arm7tdmi
851b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM720T)	=-mtune=arm7tdmi
861b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM740T)	=-mtune=arm7tdmi
871b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM9TDMI)	=-mtune=arm9tdmi
881b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM940T)	=-mtune=arm9tdmi
891b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM946E)	=$(call cc-option,-mtune=arm9e,-mtune=arm9tdmi)
901b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM920T)	=-mtune=arm9tdmi
911b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM922T)	=-mtune=arm9tdmi
921b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM925T)	=-mtune=arm9tdmi
931b21376aSDouglas Andersontune-$(CONFIG_CPU_ARM926T)	=-mtune=arm9tdmi
941b21376aSDouglas Andersontune-$(CONFIG_CPU_FA526)	=-mtune=arm9tdmi
951b21376aSDouglas Andersontune-$(CONFIG_CPU_SA110)	=-mtune=strongarm110
961b21376aSDouglas Andersontune-$(CONFIG_CPU_SA1100)	=-mtune=strongarm1100
971b21376aSDouglas Andersontune-$(CONFIG_CPU_XSCALE)	=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
981b21376aSDouglas Andersontune-$(CONFIG_CPU_XSC3)		=$(call cc-option,-mtune=xscale,-mtune=strongarm110) -Wa,-mcpu=xscale
991b21376aSDouglas Andersontune-$(CONFIG_CPU_FEROCEON)	=$(call cc-option,-mtune=marvell-f,-mtune=xscale)
1001b21376aSDouglas Andersontune-$(CONFIG_CPU_V6)		=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
1011b21376aSDouglas Andersontune-$(CONFIG_CPU_V6K)		=$(call cc-option,-mtune=arm1136j-s,-mtune=strongarm)
1021b21376aSDouglas Anderson
1031b21376aSDouglas Anderson# Evaluate tune cc-option calls now
1041b21376aSDouglas Andersontune-y := $(tune-y)
1051da177e4SLinus Torvalds
106704bdda0SNicolas Pitreifeq ($(CONFIG_AEABI),y)
10722905a24SStefan AgnerCFLAGS_ABI	:=-mabi=aapcs-linux -mfpu=vfp
108704bdda0SNicolas Pitreelse
109c28a814fSCatalin MarinasCFLAGS_ABI	:=$(call cc-option,-mapcs-32,-mabi=apcs-gnu) $(call cc-option,-mno-thumb-interwork,)
110704bdda0SNicolas Pitreendif
111704bdda0SNicolas Pitre
112adf8b37bSCatalin Marinasifeq ($(CONFIG_ARM_UNWIND),y)
113adf8b37bSCatalin MarinasCFLAGS_ABI	+=-funwind-tables
114adf8b37bSCatalin Marinasendif
115adf8b37bSCatalin Marinas
116b0fe66cfSNathan Chancellorifeq ($(CONFIG_CC_IS_CLANG),y)
117b0fe66cfSNathan ChancellorCFLAGS_ABI	+= -meabi gnu
118b0fe66cfSNathan Chancellorendif
119b0fe66cfSNathan Chancellor
12075fea300SNicolas Pitre# Accept old syntax despite ".syntax unified"
12175fea300SNicolas PitreAFLAGS_NOWARN	:=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
12275fea300SNicolas Pitre
12316c79651SCatalin Marinasifeq ($(CONFIG_THUMB2_KERNEL),y)
124b752bb40SRussell KingCFLAGS_ISA	:=-mthumb -Wa,-mimplicit-it=always $(AFLAGS_NOWARN)
12591802a8eSArnd BergmannAFLAGS_ISA	:=$(CFLAGS_ISA) -Wa$(comma)-mthumb
1266f685c5cSDave Martin# Work around buggy relocation from gas if requested:
1276f685c5cSDave Martinifeq ($(CONFIG_THUMB2_AVOID_R_ARM_THM_JUMP11),y)
128336303aeSCao jinKBUILD_CFLAGS_MODULE	+=-fno-optimize-sibling-calls
1296f685c5cSDave Martinendif
13091802a8eSArnd Bergmannelse
13175fea300SNicolas PitreCFLAGS_ISA	:=$(call cc-option,-marm,) $(AFLAGS_NOWARN)
13291802a8eSArnd BergmannAFLAGS_ISA	:=$(CFLAGS_ISA)
13316c79651SCatalin Marinasendif
13416c79651SCatalin Marinas
135704bdda0SNicolas Pitre# Need -Uarm for gcc < 3.x
13691802a8eSArnd BergmannKBUILD_CFLAGS	+=$(CFLAGS_ABI) $(CFLAGS_ISA) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm
13791802a8eSArnd BergmannKBUILD_AFLAGS	+=$(CFLAGS_ABI) $(AFLAGS_ISA) $(arch-y) $(tune-y) -include asm/unified.h -msoft-float
1381da177e4SLinus Torvalds
1391f2f01b1SLuc Van OostenryckCHECKFLAGS	+= -D__arm__
1401da177e4SLinus Torvalds
1411da177e4SLinus Torvalds#Default value
1425290dc29SThomas Gleixnerhead-y		:= arch/arm/kernel/head$(MMUEXT).o
14310508b20SDaniel Thompson
14410508b20SDaniel Thompson# Text offset. This list is sorted numerically by address in order to
14510508b20SDaniel Thompson# provide a means to avoid/resolve conflicts in multi-arch kernels.
1469d4f13e5SRussell Kingtextofs-y	:= 0x00008000
147c4761b69SVasily Khoruzhick# We don't want the htc bootloader to corrupt kernel during resume
148c4761b69SVasily Khoruzhicktextofs-$(CONFIG_PM_H1940)      := 0x00108000
14986aeee4dSAndreas Färber# RTD1195 has Boot ROM at start of address space
15086aeee4dSAndreas Färbertextofs-$(CONFIG_ARCH_REALTEK)  := 0x00108000
1511da177e4SLinus Torvalds# SA1111 DMA bug: we don't want the kernel to live in precious DMA-able memory
152b4175b89SRussell Kingifeq ($(CONFIG_ARCH_SA1100),y)
1539d4f13e5SRussell Kingtextofs-$(CONFIG_SA1111) := 0x00208000
1541da177e4SLinus Torvaldsendif
155f125e2d4SChristian Lampartertextofs-$(CONFIG_ARCH_IPQ40XX) := 0x00208000
1569e775ad1SStephen Boydtextofs-$(CONFIG_ARCH_MSM8X60) := 0x00208000
1579e775ad1SStephen Boydtextofs-$(CONFIG_ARCH_MSM8960) := 0x00208000
158d850f3e5SMartin Blumenstingltextofs-$(CONFIG_ARCH_MESON) := 0x00208000
1591d22924eSAnders Bergtextofs-$(CONFIG_ARCH_AXXIA) := 0x00308000
160b4175b89SRussell King
161b4175b89SRussell King# Machine directory name.  This list is sorted alphanumerically
162b4175b89SRussell King# by CONFIG_* macro name.
1636bb8536cSAndreas Färbermachine-$(CONFIG_ARCH_ACTIONS)		+= actions
164445d9b30STsahee Zidenbergmachine-$(CONFIG_ARCH_ALPINE)		+= alpine
165590b460cSLars Perssonmachine-$(CONFIG_ARCH_ARTPEC)		+= artpec
16687dfe496SJoel Stanleymachine-$(CONFIG_ARCH_ASPEED)           += aspeed
167387798b3SRob Herringmachine-$(CONFIG_ARCH_AT91)		+= at91
1681d22924eSAnders Bergmachine-$(CONFIG_ARCH_AXXIA)		+= axxia
1698ac49e04SChristian Daudtmachine-$(CONFIG_ARCH_BCM)		+= bcm
1701c37fa10SSebastian Hesselbarthmachine-$(CONFIG_ARCH_BERLIN)		+= berlin
171387798b3SRob Herringmachine-$(CONFIG_ARCH_CLPS711X)		+= clps711x
172387798b3SRob Herringmachine-$(CONFIG_ARCH_CNS3XXX)		+= cns3xxx
173387798b3SRob Herringmachine-$(CONFIG_ARCH_DAVINCI)		+= davinci
17416083d45SBaruch Siachmachine-$(CONFIG_ARCH_DIGICOLOR)	+= digicolor
175387798b3SRob Herringmachine-$(CONFIG_ARCH_DOVE)		+= dove
176387798b3SRob Herringmachine-$(CONFIG_ARCH_EBSA110)		+= ebsa110
1776d85e2b0SUwe Kleine-Königmachine-$(CONFIG_ARCH_EFM32)		+= efm32
178387798b3SRob Herringmachine-$(CONFIG_ARCH_EP93XX)		+= ep93xx
1796eddacaeSRussell Kingmachine-$(CONFIG_ARCH_EXYNOS)		+= exynos
180c3c963e1SUwe Kleine-Königmachine-$(CONFIG_ARCH_FOOTBRIDGE)	+= footbridge
181387798b3SRob Herringmachine-$(CONFIG_ARCH_GEMINI)		+= gemini
182387798b3SRob Herringmachine-$(CONFIG_ARCH_HIGHBANK)		+= highbank
1837685b125SHaojian Zhuangmachine-$(CONFIG_ARCH_HISI)		+= hisi
184387798b3SRob Herringmachine-$(CONFIG_ARCH_INTEGRATOR)	+= integrator
185387798b3SRob Herringmachine-$(CONFIG_ARCH_IOP32X)		+= iop32x
186387798b3SRob Herringmachine-$(CONFIG_ARCH_IXP4XX)		+= ixp4xx
1876eddacaeSRussell Kingmachine-$(CONFIG_ARCH_KEYSTONE)		+= keystone
188e8d235d4SJoachim Eastwoodmachine-$(CONFIG_ARCH_LPC18XX)		+= lpc18xx
189387798b3SRob Herringmachine-$(CONFIG_ARCH_LPC32XX)		+= lpc32xx
1903b8f5030SCarlo Caionemachine-$(CONFIG_ARCH_MESON)		+= meson
191387798b3SRob Herringmachine-$(CONFIG_ARCH_MMP)		+= mmp
1921847119dSVladimir Murzinmachine-$(CONFIG_ARCH_MPS2)		+= vexpress
19317723fd3SJonas Jensenmachine-$(CONFIG_ARCH_MOXART)		+= moxart
194387798b3SRob Herringmachine-$(CONFIG_ARCH_MV78XX0)		+= mv78xx0
1956eddacaeSRussell Kingmachine-$(CONFIG_ARCH_MVEBU)		+= mvebu
196387798b3SRob Herringmachine-$(CONFIG_ARCH_MXC)		+= imx
197f682a218SMatthias Bruggermachine-$(CONFIG_ARCH_MEDIATEK)		+= mediatek
1989fb29c73SSugaya Taichimachine-$(CONFIG_ARCH_MILBEAUT)		+= milbeaut
199387798b3SRob Herringmachine-$(CONFIG_ARCH_MXS)		+= mxs
200*312b62b6SDaniel Palmermachine-$(CONFIG_ARCH_MSTARV7)		+= mstar
201387798b3SRob Herringmachine-$(CONFIG_ARCH_NOMADIK)		+= nomadik
2027bffa14cSBrendan Higginsmachine-$(CONFIG_ARCH_NPCM)		+= npcm
2039851ca57SDaniel Tangmachine-$(CONFIG_ARCH_NSPIRE)		+= nspire
204e330ea5eSNeil Armstrongmachine-$(CONFIG_ARCH_OXNAS)		+= oxnas
205387798b3SRob Herringmachine-$(CONFIG_ARCH_OMAP1)		+= omap1
206387798b3SRob Herringmachine-$(CONFIG_ARCH_OMAP2PLUS)	+= omap2
207387798b3SRob Herringmachine-$(CONFIG_ARCH_ORION5X)		+= orion5x
208387798b3SRob Herringmachine-$(CONFIG_ARCH_PICOXCELL)	+= picoxcell
209387798b3SRob Herringmachine-$(CONFIG_ARCH_PXA)		+= pxa
2108fc1b0f8SKumar Galamachine-$(CONFIG_ARCH_QCOM)		+= qcom
21178e3dbc1SAndreas Färbermachine-$(CONFIG_ARCH_RDA)		+= rda
21286aeee4dSAndreas Färbermachine-$(CONFIG_ARCH_REALTEK)		+= realtek
213387798b3SRob Herringmachine-$(CONFIG_ARCH_REALVIEW)		+= realview
214d63dc051SHeiko Stuebnermachine-$(CONFIG_ARCH_ROCKCHIP)		+= rockchip
215387798b3SRob Herringmachine-$(CONFIG_ARCH_RPC)		+= rpc
216acf2d41dSKukjin Kimmachine-$(CONFIG_ARCH_S3C24XX)		+= s3c24xx
217387798b3SRob Herringmachine-$(CONFIG_ARCH_S3C64XX)		+= s3c64xx
218387798b3SRob Herringmachine-$(CONFIG_ARCH_S5PV210)		+= s5pv210
219387798b3SRob Herringmachine-$(CONFIG_ARCH_SA1100)		+= sa1100
220d9be9cebSGeert Uytterhoevenmachine-$(CONFIG_ARCH_RENESAS)	 	+= shmobile
2216eddacaeSRussell Kingmachine-$(CONFIG_ARCH_SIRF)		+= prima2
2226eddacaeSRussell Kingmachine-$(CONFIG_ARCH_SOCFPGA)		+= socfpga
2236eddacaeSRussell Kingmachine-$(CONFIG_ARCH_STI)		+= sti
2249b799b78SMaxime Coquelinmachine-$(CONFIG_ARCH_STM32)		+= stm32
2256eddacaeSRussell Kingmachine-$(CONFIG_ARCH_SUNXI)		+= sunxi
226d6de5b02SMarc Gonzalezmachine-$(CONFIG_ARCH_TANGO)		+= tango
227387798b3SRob Herringmachine-$(CONFIG_ARCH_TEGRA)		+= tegra
228387798b3SRob Herringmachine-$(CONFIG_ARCH_U300)		+= u300
229387798b3SRob Herringmachine-$(CONFIG_ARCH_U8500)		+= ux500
230387798b3SRob Herringmachine-$(CONFIG_ARCH_VERSATILE)	+= versatile
231387798b3SRob Herringmachine-$(CONFIG_ARCH_VEXPRESS)		+= vexpress
232387798b3SRob Herringmachine-$(CONFIG_ARCH_VT8500)		+= vt8500
233acede515SJun Niemachine-$(CONFIG_ARCH_ZX)		+= zx
234387798b3SRob Herringmachine-$(CONFIG_ARCH_ZYNQ)		+= zynq
2356eddacaeSRussell Kingmachine-$(CONFIG_PLAT_SPEAR)		+= spear
236b4175b89SRussell King
237b4175b89SRussell King# Platform directory name.  This list is sorted alphanumerically
238b4175b89SRussell King# by CONFIG_* macro name.
239e245f969STomasz Figaplat-$(CONFIG_ARCH_EXYNOS)	+= samsung
240387798b3SRob Herringplat-$(CONFIG_ARCH_OMAP)	+= omap
241387798b3SRob Herringplat-$(CONFIG_ARCH_S3C64XX)	+= samsung
242aa42587aSTomasz Figaplat-$(CONFIG_ARCH_S5PV210)	+= samsung
243387798b3SRob Herringplat-$(CONFIG_PLAT_ORION)	+= orion
244387798b3SRob Herringplat-$(CONFIG_PLAT_PXA)		+= pxa
24509ec1d7eSKukjin Kimplat-$(CONFIG_PLAT_S3C24XX)	+= samsung
246387798b3SRob Herringplat-$(CONFIG_PLAT_VERSATILE)	+= versatile
2471da177e4SLinus Torvalds
2481da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_EBSA110),y)
2491da177e4SLinus Torvalds# This is what happens if you forget the IOCS16 line.
2501da177e4SLinus Torvalds# PCMCIA cards stop working.
2511da177e4SLinus TorvaldsCFLAGS_3c589_cs.o :=-DISA_SIXTEEN_BIT_PERIPHERAL
2521da177e4SLinus Torvaldsexport CFLAGS_3c589_cs.o
2531da177e4SLinus Torvaldsendif
2541da177e4SLinus Torvalds
2559d4f13e5SRussell King# The byte offset of the kernel image in RAM from the start of RAM.
2569d4f13e5SRussell KingTEXT_OFFSET := $(textofs-y)
2571da177e4SLinus Torvalds
258f44f82e8SRussell King# The first directory contains additional information for the boot setup code
2591da177e4SLinus Torvaldsifneq ($(machine-y),)
260f44f82e8SRussell KingMACHINE  := arch/arm/mach-$(word 1,$(machine-y))/
2611da177e4SLinus Torvaldselse
2621da177e4SLinus TorvaldsMACHINE  :=
2631da177e4SLinus Torvaldsendif
264387798b3SRob Herringifeq ($(CONFIG_ARCH_MULTIPLATFORM),y)
265387798b3SRob HerringMACHINE  :=
266387798b3SRob Herringendif
2671da177e4SLinus Torvalds
268f44f82e8SRussell Kingmachdirs := $(patsubst %,arch/arm/mach-%/,$(machine-y))
269aa42587aSTomasz Figaplatdirs := $(patsubst %,arch/arm/plat-%/,$(sort $(plat-y)))
270f44f82e8SRussell King
271387798b3SRob Herringifneq ($(CONFIG_ARCH_MULTIPLATFORM),y)
272de8a06f6SArnd Bergmannifneq ($(CONFIG_ARM_SINGLE_ARMV7M),y)
273f44f82e8SRussell KingKBUILD_CPPFLAGS += $(patsubst %,-I$(srctree)/%include,$(machdirs) $(platdirs))
274f44f82e8SRussell Kingendif
275387798b3SRob Herringendif
276f44f82e8SRussell King
277f8c07de6SHyok S. Choiexport	TEXT_OFFSET GZFLAGS MMUEXT
2781da177e4SLinus Torvalds
2791da177e4SLinus Torvaldscore-$(CONFIG_FPE_NWFPE)	+= arch/arm/nwfpe/
2803c86889bSMasahiro Yamada# Put arch/arm/fastfpe/ to use this.
2813c86889bSMasahiro Yamadacore-$(CONFIG_FPE_FASTFPE)	+= $(patsubst $(srctree)/%,%,$(wildcard $(srctree)/arch/arm/fastfpe/))
2821da177e4SLinus Torvaldscore-$(CONFIG_VFP)		+= arch/arm/vfp/
2834c071ee5SStefano Stabellinicore-$(CONFIG_XEN)		+= arch/arm/xen/
284e5b61debSNathan Lynchcore-$(CONFIG_VDSO)		+= arch/arm/vdso/
2851da177e4SLinus Torvalds
286c62d0f2aSNicolas Pitre# If we have a machine-specific directory, then include it in the build.
287c62d0f2aSNicolas Pitrecore-y				+= arch/arm/kernel/ arch/arm/mm/ arch/arm/common/
288fca08f32SWang Nancore-y				+= arch/arm/probes/
289ddecdfceSMircea Gherzancore-y				+= arch/arm/net/
290f0be44f4SDavid McCulloughcore-y				+= arch/arm/crypto/
291c62d0f2aSNicolas Pitrecore-y				+= $(machdirs) $(platdirs)
292c62d0f2aSNicolas Pitre
2932a58e142SMasahiro Yamada# For cleaning
2942a58e142SMasahiro Yamadacore-				+= $(patsubst %,arch/arm/mach-%/, $(machine-))
2952a58e142SMasahiro Yamadacore-				+= $(patsubst %,arch/arm/plat-%/, $(plat-))
2962a58e142SMasahiro Yamada
2971da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)      += arch/arm/oprofile/
2981da177e4SLinus Torvalds
29930c2f90bSNicolas Pitrelibs-y				:= arch/arm/lib/ $(libs-y)
3001da177e4SLinus Torvalds
3011da177e4SLinus Torvalds# Default target when executing plain make
302152e6744SMichal Marekboot := arch/arm/boot
3031da177e4SLinus Torvaldsifeq ($(CONFIG_XIP_KERNEL),y)
304152e6744SMichal MarekKBUILD_IMAGE := $(boot)/xipImage
3051da177e4SLinus Torvaldselse
306152e6744SMichal MarekKBUILD_IMAGE := $(boot)/zImage
3071da177e4SLinus Torvaldsendif
3081da177e4SLinus Torvalds
309189af465SArd Biesheuvelifeq ($(CONFIG_STACKPROTECTOR_PER_TASK),y)
310189af465SArd Biesheuvelprepare: stack_protector_prepare
311189af465SArd Biesheuvelstack_protector_prepare: prepare0
31289604523SArd Biesheuvel	$(eval SSP_PLUGIN_CFLAGS := \
313189af465SArd Biesheuvel		-fplugin-arg-arm_ssp_per_task_plugin-tso=$(shell	\
314189af465SArd Biesheuvel			awk '{if ($$2 == "THREAD_SZ_ORDER") print $$3;}'\
315189af465SArd Biesheuvel				include/generated/asm-offsets.h)	\
316189af465SArd Biesheuvel		-fplugin-arg-arm_ssp_per_task_plugin-offset=$(shell	\
317189af465SArd Biesheuvel			awk '{if ($$2 == "TI_STACK_CANARY") print $$3;}'\
318189af465SArd Biesheuvel				include/generated/asm-offsets.h))
31989604523SArd Biesheuvel	$(eval KBUILD_CFLAGS += $(SSP_PLUGIN_CFLAGS))
32089604523SArd Biesheuvel	$(eval GCC_PLUGINS_CFLAGS += $(SSP_PLUGIN_CFLAGS))
321189af465SArd Biesheuvelendif
322189af465SArd Biesheuvel
32337c8a5faSRob Herringall:	$(notdir $(KBUILD_IMAGE))
32451342d71SRussell King
3251da177e4SLinus Torvalds
32696a8fae0SRussell Kingarchheaders:
32796a8fae0SRussell King	$(Q)$(MAKE) $(build)=arch/arm/tools uapi
32896a8fae0SRussell King
32966206536SSam Ravnborgarchprepare:
3304e2648dbSRussell King	$(Q)$(MAKE) $(build)=arch/arm/tools kapi
3311da177e4SLinus Torvalds
3321da177e4SLinus Torvalds# Convert bzImage to zImage
3331da177e4SLinus TorvaldsbzImage: zImage
3341da177e4SLinus Torvalds
33519514fc6SRobert RichterBOOT_TARGETS	= zImage Image xipImage bootpImage uImage
33619514fc6SRobert RichterINSTALL_TARGETS	= zinstall uinstall install
33719514fc6SRobert Richter
33819514fc6SRobert RichterPHONY += bzImage $(BOOT_TARGETS) $(INSTALL_TARGETS)
33919514fc6SRobert Richter
3403939f334SMasahiro YamadabootpImage uImage: zImage
3413939f334SMasahiro YamadazImage: Image
3423939f334SMasahiro Yamada
34319514fc6SRobert Richter$(BOOT_TARGETS): vmlinux
3441da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/$@
345c6bbfbb7SMasahiro Yamada	@$(kecho) '  Kernel: $(boot)/$@ is ready'
3461da177e4SLinus Torvalds
34719514fc6SRobert Richter$(INSTALL_TARGETS):
3481da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $@
3491da177e4SLinus Torvalds
350e5b61debSNathan LynchPHONY += vdso_install
351e5b61debSNathan Lynchvdso_install:
352e5b61debSNathan Lynchifeq ($(CONFIG_VDSO),y)
353e5b61debSNathan Lynch	$(Q)$(MAKE) $(build)=arch/arm/vdso $@
354e5b61debSNathan Lynchendif
355e5b61debSNathan Lynch
3561da177e4SLinus Torvalds# We use MRPROPER_FILES and CLEAN_FILES now
3571da177e4SLinus Torvaldsarchclean:
3581da177e4SLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
3591da177e4SLinus Torvalds
3601da177e4SLinus Torvalds# My testing targets (bypasses dependencies)
3611da177e4SLinus Torvaldsbp:;	$(Q)$(MAKE) $(build)=$(boot) MACHINE=$(MACHINE) $(boot)/bootpImage
3621da177e4SLinus Torvalds
3631da177e4SLinus Torvalds
3641da177e4SLinus Torvaldsdefine archhelp
3651da177e4SLinus Torvalds  echo  '* zImage        - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
3661da177e4SLinus Torvalds  echo  '  Image         - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
3671da177e4SLinus Torvalds  echo  '* xipImage      - XIP kernel image, if configured (arch/$(ARCH)/boot/xipImage)'
368a4f14bacSUwe Kleine-König  echo  '  uImage        - U-Boot wrapped zImage'
3691da177e4SLinus Torvalds  echo  '  bootpImage    - Combined zImage and initial RAM disk'
3701da177e4SLinus Torvalds  echo  '                  (supply initrd image via make variable INITRD=<path>)'
3711da177e4SLinus Torvalds  echo  '  install       - Install uncompressed kernel'
3721da177e4SLinus Torvalds  echo  '  zinstall      - Install compressed kernel'
373a65d2922SRussell King  echo  '  uinstall      - Install U-Boot wrapped compressed kernel'
374caa27b66SSam Ravnborg  echo  '                  Install using (your) ~/bin/$(INSTALLKERNEL) or'
375caa27b66SSam Ravnborg  echo  '                  (distribution) /sbin/$(INSTALLKERNEL) or'
3761da177e4SLinus Torvalds  echo  '                  install to $$(INSTALL_PATH) and run lilo'
377e5b61debSNathan Lynch  echo  '  vdso_install  - Install unstripped vdso.so to $$(INSTALL_MOD_PATH)/vdso'
3781da177e4SLinus Torvaldsendef
379