11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
2c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# arch/sh/Makefile
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Copyright (C) 1999  Kaz Kojima
5b2d86a3fd9855380598c0c039e712a20086e119fPaul Mundt# Copyright (C) 2002 - 2008  Paul Mundt
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Copyright (C) 2002  M. R. Brown
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
8c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# This file is subject to the terms and conditions of the GNU General Public
9c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# License.  See the file "COPYING" in the main directory of this archive
10c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# for more details.
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
12d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoevenifneq ($(SUBARCH),$(ARCH))
13d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoeven  ifeq ($(CROSS_COMPILE),)
14d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoeven    CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux-  $(UTS_MACHINE)-linux-gnu-  $(UTS_MACHINE)-unknown-linux-gnu-)
15d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoeven  endif
16d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoevenendif
17d14a5fdc26986f7bac8376a339f336be18ba2a90Geert Uytterhoeven
18cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-y					:= any
19e5723e0eeb2dc16629e86d66785024ead9169000Paul Mundtisa-$(CONFIG_SH_DSP)			:= sh
20cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-$(CONFIG_CPU_SH2)			:= sh2
21e5723e0eeb2dc16629e86d66785024ead9169000Paul Mundtisa-$(CONFIG_CPU_SH2A)			:= sh2a
22cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-$(CONFIG_CPU_SH3)			:= sh3
23cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-$(CONFIG_CPU_SH4)			:= sh4
24cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-$(CONFIG_CPU_SH4A)			:= sh4a
25e5723e0eeb2dc16629e86d66785024ead9169000Paul Mundtisa-$(CONFIG_CPU_SH4AL_DSP)		:= sh4al
26c20c20047b1aa4ba6fc2bb4e9ab91402026c3e71Paul Mundtisa-$(CONFIG_CPU_SH5)			:= shmedia
27ddb72b02414228844ad46f7cbd42eccea01fb485Paul Mundt
28ddb72b02414228844ad46f7cbd42eccea01fb485Paul Mundtifeq ($(CONFIG_SUPERH32),y)
29cad8244840d1a148f638925758afd1cdf81fc839Paul Mundtisa-$(CONFIG_SH_DSP)			:= $(isa-y)-dsp
30ddb72b02414228844ad46f7cbd42eccea01fb485Paul Mundtisa-y					:= $(isa-y)-up
31ddb72b02414228844ad46f7cbd42eccea01fb485Paul Mundtendif
32cad8244840d1a148f638925758afd1cdf81fc839Paul Mundt
336240d92f2f2fb74094b66b3510733fa0a1e2631aPaul Mundtcflags-$(CONFIG_CPU_SH2)		:= $(call cc-option,-m2,)
34aab1b16a61d653173b1c5f158c51ec08dd6605b0Paul Mundtcflags-$(CONFIG_CPU_SH2A)		+= $(call cc-option,-m2a,) \
35b1923b55af43a6febb976084bf30d1a4797c92c9Geert Uytterhoeven					   $(call cc-option,-m2a-nofpu,) \
36b1923b55af43a6febb976084bf30d1a4797c92c9Geert Uytterhoeven					   $(call cc-option,-m4-nofpu,)
376240d92f2f2fb74094b66b3510733fa0a1e2631aPaul Mundtcflags-$(CONFIG_CPU_SH3)		:= $(call cc-option,-m3,)
386240d92f2f2fb74094b66b3510733fa0a1e2631aPaul Mundtcflags-$(CONFIG_CPU_SH4)		:= $(call cc-option,-m4,) \
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(call cc-option,-mno-implicit-fp,-m4-nofpu)
40aab1b16a61d653173b1c5f158c51ec08dd6605b0Paul Mundtcflags-$(CONFIG_CPU_SH4A)		+= $(call cc-option,-m4a,) \
416240d92f2f2fb74094b66b3510733fa0a1e2631aPaul Mundt					   $(call cc-option,-m4a-nofpu,)
428bcc5c1c332af97ba731f99fda780a47911e476fPaul Mundtcflags-$(CONFIG_CPU_SH4AL_DSP)		+= $(call cc-option,-m4al,)
43c20c20047b1aa4ba6fc2bb4e9ab91402026c3e71Paul Mundtcflags-$(CONFIG_CPU_SH5)		:= $(call cc-option,-m5-32media-nofpu,)
4453644087a607040a56d883df612b588814a56f11Paul Mundt
455dd614761f05f56b93c94541aa92e6449920516cPaul Mundtifeq ($(cflags-y),)
465dd614761f05f56b93c94541aa92e6449920516cPaul Mundt#
475dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# In the case where we are stuck with a compiler that has been uselessly
485dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# restricted to a particular ISA, a favourite default of newer GCCs when
495dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# extensive multilib targets are not provided, ensure we get the best fit
505dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# regarding FP generation. This is intentionally stupid (albeit many
515dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# orders of magnitude less than GCC's default behaviour), as anything
525dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# with a large number of multilib targets better have been built
535dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# correctly for the target in mind.
545dd614761f05f56b93c94541aa92e6449920516cPaul Mundt#
555dd614761f05f56b93c94541aa92e6449920516cPaul Mundtcflags-y	+= $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \
565dd614761f05f56b93c94541aa92e6449920516cPaul Mundt		     grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//')
575dd614761f05f56b93c94541aa92e6449920516cPaul Mundt# At this point, anything goes.
585dd614761f05f56b93c94541aa92e6449920516cPaul Mundtisaflags-y	:= $(call as-option,-Wa$(comma)-isa=any,)
595dd614761f05f56b93c94541aa92e6449920516cPaul Mundtelse
60da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt#
61da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that
62da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# support it, while -Wa,-dsp by itself limits the range of usable opcodes
63da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# on certain CPU subtypes. Try the ISA variant first, and if that fails,
64da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# fall back on -Wa,-dsp for the old binutils versions. Even without DSP
65da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# opcodes, we always want the best ISA tuning the version of binutils
66da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt# will provide.
67da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt#
68da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundtisaflags-y	:= $(call as-option,-Wa$(comma)-isa=$(isa-y),)
69da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt
70da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundtisaflags-$(CONFIG_SH_DSP)		:= \
71da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt	$(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp)
725dd614761f05f56b93c94541aa92e6449920516cPaul Mundtendif
735dd614761f05f56b93c94541aa92e6449920516cPaul Mundt
745dd614761f05f56b93c94541aa92e6449920516cPaul Mundtcflags-$(CONFIG_CPU_BIG_ENDIAN)		+= -mb
755dd614761f05f56b93c94541aa92e6449920516cPaul Mundtcflags-$(CONFIG_CPU_LITTLE_ENDIAN)	+= -ml
76da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundt
775dd614761f05f56b93c94541aa92e6449920516cPaul Mundtcflags-y	+= $(call cc-option,-mno-fdpic)
78da2f5f7bf4a39f9613fc04d7030cffb63e435e1dPaul Mundtcflags-y	+= $(isaflags-y) -ffreestanding
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
80c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul MundtOBJCOPYFLAGS	:= -O binary -R .note -R .note.gnu.build-id -R .comment \
81c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt		   -R .stab -R .stabstr -S
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
83c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# Give the various platforms the opportunity to set default image types
841a30603233fdd104aba430fd8f3443160474b6bbPaul Mundtdefaultimage-$(CONFIG_SUPERH32)			:= zImage
851a30603233fdd104aba430fd8f3443160474b6bbPaul Mundtdefaultimage-$(CONFIG_SH_SH7785LCR)		:= uImage
866f5cd2bd59c3bbaf073a7a52fcdefded939bd306Paul Mundtdefaultimage-$(CONFIG_SH_RSK)			:= uImage
87ae68df5635a191c7edb75f5c1c1406353cb24a9fPaul Mundtdefaultimage-$(CONFIG_SH_URQUELL)		:= uImage
888144a7dd51712ab58d052f4df4420768ec5489efPaul Mundtdefaultimage-$(CONFIG_SH_MIGOR)			:= uImage
898144a7dd51712ab58d052f4df4420768ec5489efPaul Mundtdefaultimage-$(CONFIG_SH_AP325RXA)		:= uImage
90e857bfd4604a3a4edaf9c7038db880d9f78aecbdNobuhiro Iwamatsudefaultimage-$(CONFIG_SH_SH7757LCR)		:= uImage
918144a7dd51712ab58d052f4df4420768ec5489efPaul Mundtdefaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE)	:= uImage
92709420dd4e75083ee7920e61c2d0bcc3db9b7405Paul Mundtdefaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE)	:= vmlinux
93709420dd4e75083ee7920e61c2d0bcc3db9b7405Paul Mundtdefaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE)	:= vmlinux
94f36af73304555849985b1fb5c0821c1bfab3a5a0Paul Mundt
95c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundt# Set some sensible Kbuild defaults
96c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul MundtKBUILD_IMAGE		:= $(defaultimage-y)
971da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
981da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
991da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Choosing incompatible machines durings configuration will result in
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# error messages during linking.
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
102b4db3aec8351c78df77bbd95f1951a4dd0246853Paul Mundtifdef CONFIG_SUPERH32
103f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtUTS_MACHINE		:= sh
104f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtBITS			:= 32
105f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtLDFLAGS_vmlinux		+= -e _stext
106f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtKBUILD_DEFCONFIG	:= shx3_defconfig
107b4db3aec8351c78df77bbd95f1951a4dd0246853Paul Mundtelse
108f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtUTS_MACHINE		:= sh64
109f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtBITS			:= 64
110f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtLDFLAGS_vmlinux		+= --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
111f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul Mundt			   --defsym phys_stext_shmedia=phys_stext+1 \
112f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul Mundt			   -e phys_stext_shmedia
113f9e2b97dc2cf832ccceea2a2e6eccc4bc9af72cfPaul MundtKBUILD_DEFCONFIG	:= cayman_defconfig
114b4db3aec8351c78df77bbd95f1951a4dd0246853Paul Mundtendif
1151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifdef CONFIG_CPU_LITTLE_ENDIAN
1177b022d07a0fd2ce02d4456b732c674ff1d16f5cePaul Mundtld-bfd			:= elf32-$(UTS_MACHINE)-linux
1188e780be960c3e7000a94652bc56efeb3c932ee24Paul MundtLDFLAGS_vmlinux		+= --defsym jiffies=jiffies_64 --oformat $(ld-bfd)
1191da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsLDFLAGS			+= -EL
1201da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldselse
1217b022d07a0fd2ce02d4456b732c674ff1d16f5cePaul Mundtld-bfd			:= elf32-$(UTS_MACHINE)big-linux
1228e780be960c3e7000a94652bc56efeb3c932ee24Paul MundtLDFLAGS_vmlinux		+= --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd)
1231da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsLDFLAGS			+= -EB
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
126b20883562455060272126c36563a7d8edafc30d3Paul Mundtexport ld-bfd BITS
1277b022d07a0fd2ce02d4456b732c674ff1d16f5cePaul Mundt
12841fe22f6553d1384fbef20b195b8c61ed6e768a1Thomas Gleixnerhead-y	:= arch/sh/kernel/head_$(BITS).o
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
130c8b5d9dcbc94ae5e7d9ed647246df4454d25332ePaul Mundtcore-y				+= arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
1314b565680d16300acab0ff167e24f0ea289a6bd5dTakashi YOSHIIcore-$(CONFIG_SH_FPU_EMU)	+= arch/sh/math-emu/
1321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
133c8b5d9dcbc94ae5e7d9ed647246df4454d25332ePaul Mundt# Mach groups
134939a24a6df24649cea9fd0ff54fe71ee0dc1d61ePaul Mundtmachdir-$(CONFIG_SOLUTION_ENGINE)		+= mach-se
135da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_HP6XX)			+= mach-hp6xx
136da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_DREAMCAST)			+= mach-dreamcast
137da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_SH03)			+= mach-sh03
138da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_RTS7751R2D)			+= mach-r2d
139da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_HIGHLANDER)			+= mach-highlander
140da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_MIGOR)			+= mach-migor
14153528928d1260747c294b63218d9886c74df4c31Magnus Dammmachdir-$(CONFIG_SH_AP325RXA)			+= mach-ap325rxa
142e7d165146a7de5ceb4f68e188b2679f003744f54Magnus Dammmachdir-$(CONFIG_SH_KFR2R09)			+= mach-kfr2r09
1434138b74066cc33ede31bfd6cb2b7a5e685cfd327Kuninori Morimotomachdir-$(CONFIG_SH_ECOVEC)			+= mach-ecovec24
144da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_SDK7780)			+= mach-sdk7780
14502bf6cc72cc2a6258411ddf1649f33a65fc9a06ePaul Mundtmachdir-$(CONFIG_SH_SDK7786)			+= mach-sdk7786
146da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_X3PROTO)			+= mach-x3proto
147da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_SH7763RDP)			+= mach-sh7763rdp
148da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_SH4202_MICRODEV)		+= mach-microdev
149da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_LANDISK)			+= mach-landisk
150da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_LBOX_RE2)			+= mach-lboxre2
151da2014a2b080e7f3024a4eb6917d47069ad9620bPaul Mundtmachdir-$(CONFIG_SH_CAYMAN)			+= mach-cayman
152ea0aac1e1327476d2f6a38f08145281237cf1b03Paul Mundtmachdir-$(CONFIG_SH_RSK)			+= mach-rsk
15325f8151bdcdd62c6b879e3669a562c0d329eee4aPaul Mundt
1541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifneq ($(machdir-y),)
15525f8151bdcdd62c6b879e3669a562c0d329eee4aPaul Mundtcore-y	+= $(addprefix arch/sh/boards/, \
15625f8151bdcdd62c6b879e3669a562c0d329eee4aPaul Mundt	     $(filter-out ., $(patsubst %,%/,$(machdir-y))))
1571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
1581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1597639a4541f7e7abb1295ff8ab39cc2f5842239aePaul Mundt# Common machine type headers. Not part of the arch/sh/boards/ hierarchy.
1607639a4541f7e7abb1295ff8ab39cc2f5842239aePaul Mundtmachdir-y	+= mach-common
1617639a4541f7e7abb1295ff8ab39cc2f5842239aePaul Mundt
1621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Companion chips
1634aafae27d0ce73f8507b8983b36006b734aa343aKristoffer Ericsoncore-$(CONFIG_HD6446X_SERIES)	+= arch/sh/cchips/hd6446x/
1641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
16593dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt#
16693dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# CPU header paths
16793dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt#
16893dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# These are ordered by optimization level. A CPU family that is a subset
16993dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# of another (ie, SH-2A / SH-2), is picked up first, with increasing
17093dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# levels of genericness if nothing more suitable is situated in the
17193dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# hierarchy.
17293dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt#
17393dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt# As an example, in order of preference, SH-2A > SH-2 > common definitions.
17493dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt#
17593dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-$(CONFIG_CPU_SH2A)	+= cpu-sh2a
17693dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-$(CONFIG_CPU_SH2)	+= cpu-sh2
17793dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-$(CONFIG_CPU_SH3)	+= cpu-sh3
17861a6976bf19a6cf5dfcf37c3536665b316f22d49Paul Mundtcpuincdir-$(CONFIG_CPU_SH4A)	+= cpu-sh4a
17993dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-$(CONFIG_CPU_SH4)	+= cpu-sh4
18093dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-$(CONFIG_CPU_SH5)	+= cpu-sh5
18193dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcpuincdir-y			+= cpu-common	# Must be last
1821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1831da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdrivers-y			+= arch/sh/drivers/
1841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/sh/oprofile/
1851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1861da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsboot := arch/sh/boot
1871da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
18893dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundtcflags-y	+= $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \
18993dc544cf4892b9188d7d0d4946b0394020b4551Paul Mundt		   $(foreach d, $(machdir-y), -Iarch/sh/include/$(d))
1901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
191f15cbe6f1a4b4d9df59142fc8e4abb973302cf44Paul MundtKBUILD_CFLAGS		+= -pipe $(cflags-y)
192f15cbe6f1a4b4d9df59142fc8e4abb973302cf44Paul MundtKBUILD_CPPFLAGS		+= $(cflags-y)
193f15cbe6f1a4b4d9df59142fc8e4abb973302cf44Paul MundtKBUILD_AFLAGS		+= $(cflags-y)
1941da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
195473d1cf4ee623b043790838bcf77e77958840bf2Paul Mundtifeq ($(CONFIG_MCOUNT),y)
196473d1cf4ee623b043790838bcf77e77958840bf2Paul Mundt  KBUILD_CFLAGS += -pg
197473d1cf4ee623b043790838bcf77e77958840bf2Paul Mundtendif
198473d1cf4ee623b043790838bcf77e77958840bf2Paul Mundt
199bd353861c735b2265c9d8b2559960c693e7c68abMatt Flemingifeq ($(CONFIG_DWARF_UNWINDER),y)
200bd353861c735b2265c9d8b2559960c693e7c68abMatt Fleming  KBUILD_CFLAGS += -fasynchronous-unwind-tables
201bd353861c735b2265c9d8b2559960c693e7c68abMatt Flemingendif
202bd353861c735b2265c9d8b2559960c693e7c68abMatt Fleming
20349de935c107a53b0eba336efceb1dc3a8be64f87Adrian Bunklibs-$(CONFIG_SUPERH32)		:= arch/sh/lib/	$(libs-y)
204180ae2037f5bc33b0597ddbb76d36b08a74a238aPaul Mundtlibs-$(CONFIG_SUPERH64)		:= arch/sh/lib64/ $(libs-y)
20549de935c107a53b0eba336efceb1dc3a8be64f87Adrian Bunk
20650cfa79dcb91a7c40038b7a13b7e2242b541242fPaul MundtBOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \
207eca50f14b88315bd31183a17c89e53534f2ed2faPaul Mundt	       uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \
208eca50f14b88315bd31183a17c89e53534f2ed2faPaul Mundt	       romImage
2093252b11fc4790d046b93f300c898df2f7cd7c176Sam RavnborgPHONY += $(BOOT_TARGETS)
2101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
211c2f1755becdc7c78ca07a516d358d9fa7a0a2707Paul Mundtall: $(KBUILD_IMAGE)
2121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
213ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt$(BOOT_TARGETS): vmlinux
2141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
2151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2161da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscompressed: zImage
2171da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2183252b11fc4790d046b93f300c898df2f7cd7c176Sam Ravnborgarchprepare:
2193252b11fc4790d046b93f300c898df2f7cd7c176Sam Ravnborg	$(Q)$(MAKE) $(build)=arch/sh/tools include/generated/machtypes.h
220d088f323574ea932a9bfc65302120e1526131887Paul Mundt
2211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsarchclean:
2221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
223c1d0d32a603ed06377f404adf2c538de33bb3634Paul Mundt	$(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall
2241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
2251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdefine archhelp
226ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '  zImage 	           - Compressed kernel image'
227fdeb076f20df14b1c7f2817362172548d146b121Paul Mundt	@echo '  romImage	           - Compressed ROM image, if supported'
228cf00e20444fc39fe37691ca32919061bf65527b0Paul Mundt	@echo '  vmlinux.srec	           - Create an ELF S-record'
229eca50f14b88315bd31183a17c89e53534f2ed2faPaul Mundt	@echo '  vmlinux.bin	           - Create an uncompressed binary image'
230ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '* uImage  	           - Alias to bootable U-Boot image'
231ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '  uImage.srec	           - Create an S-record for U-Boot'
232a5c461bb3f74646d99464652cd5363e88434c3e1Paul Mundt	@echo '  uImage.bin	           - Kernel-only image for U-Boot (bin)'
233ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '* uImage.gz	           - Kernel-only image for U-Boot (gzip)'
234ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '  uImage.bz2	           - Kernel-only image for U-Boot (bzip2)'
235ef9b542fce00dafc6bb1d9097b045a777f4a2382Paul Mundt	@echo '  uImage.lzma	           - Kernel-only image for U-Boot (lzma)'
23650cfa79dcb91a7c40038b7a13b7e2242b541242fPaul Mundt	@echo '  uImage.xz	           - Kernel-only image for U-Boot (xz)'
237c7b16efb7d0c7fce218b2cdafa2432c5fbf57314Paul Mundt	@echo '  uImage.lzo	           - Kernel-only image for U-Boot (lzo)'
2381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendef
239