Blame view
arch/sh/Makefile
8.02 KB
1da177e4c Linux-2.6.12-rc2 |
1 |
# |
c2f1755be sh: Tidy up KBUIL... |
2 |
# arch/sh/Makefile |
1da177e4c Linux-2.6.12-rc2 |
3 4 |
# # Copyright (C) 1999 Kaz Kojima |
b2d86a3fd sh: Simplify and ... |
5 |
# Copyright (C) 2002 - 2008 Paul Mundt |
1da177e4c Linux-2.6.12-rc2 |
6 7 |
# Copyright (C) 2002 M. R. Brown # |
c2f1755be sh: Tidy up KBUIL... |
8 9 10 |
# This file is subject to the terms and conditions of the GNU General Public # License. See the file "COPYING" in the main directory of this archive # for more details. |
1da177e4c Linux-2.6.12-rc2 |
11 |
# |
d14a5fdc2 sh: Setup CROSS_C... |
12 13 14 15 16 |
ifneq ($(SUBARCH),$(ARCH)) ifeq ($(CROSS_COMPILE),) CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) endif endif |
cad824484 [PATCH] sh: Move ... |
17 |
isa-y := any |
e5723e0ee sh: Add support f... |
18 |
isa-$(CONFIG_SH_DSP) := sh |
cad824484 [PATCH] sh: Move ... |
19 |
isa-$(CONFIG_CPU_SH2) := sh2 |
e5723e0ee sh: Add support f... |
20 |
isa-$(CONFIG_CPU_SH2A) := sh2a |
cad824484 [PATCH] sh: Move ... |
21 22 23 |
isa-$(CONFIG_CPU_SH3) := sh3 isa-$(CONFIG_CPU_SH4) := sh4 isa-$(CONFIG_CPU_SH4A) := sh4a |
e5723e0ee sh: Add support f... |
24 |
isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al |
c20c20047 sh: Plug SH-5 in ... |
25 |
isa-$(CONFIG_CPU_SH5) := shmedia |
ddb72b024 sh: SHmedia ISA t... |
26 27 |
ifeq ($(CONFIG_SUPERH32),y) |
cad824484 [PATCH] sh: Move ... |
28 |
isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp |
ddb72b024 sh: SHmedia ISA t... |
29 30 |
isa-y := $(isa-y)-up endif |
cad824484 [PATCH] sh: Move ... |
31 |
|
6240d92f2 sh: Wrap CPU tuni... |
32 |
cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) |
aab1b16a6 sh: Don't let SH-... |
33 |
cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ |
6240d92f2 sh: Wrap CPU tuni... |
34 35 36 |
$(call cc-option,-m2a-nofpu,) cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,) cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ |
1da177e4c Linux-2.6.12-rc2 |
37 |
$(call cc-option,-mno-implicit-fp,-m4-nofpu) |
aab1b16a6 sh: Don't let SH-... |
38 |
cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
6240d92f2 sh: Wrap CPU tuni... |
39 |
$(call cc-option,-m4a-nofpu,) |
8bcc5c1c3 sh: Add -m4al tun... |
40 |
cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) |
c20c20047 sh: Plug SH-5 in ... |
41 |
cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
53644087a sh: Explicit endi... |
42 |
|
5dd614761 sh: Re-add suppor... |
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
ifeq ($(cflags-y),) # # In the case where we are stuck with a compiler that has been uselessly # restricted to a particular ISA, a favourite default of newer GCCs when # extensive multilib targets are not provided, ensure we get the best fit # regarding FP generation. This is intentionally stupid (albeit many # orders of magnitude less than GCC's default behaviour), as anything # with a large number of multilib targets better have been built # correctly for the target in mind. # cflags-y += $(shell $(CC) $(KBUILD_CFLAGS) -print-multi-lib | \ grep nofpu | sed q | sed -e 's/^/-/;s/;.*$$//') # At this point, anything goes. isaflags-y := $(call as-option,-Wa$(comma)-isa=any,) else |
da2f5f7bf sh: Fix DSP opcod... |
58 59 60 61 62 63 64 65 66 67 68 69 |
# # -Wa,-isa= tuning implies -Wa,-dsp for the versions of binutils that # support it, while -Wa,-dsp by itself limits the range of usable opcodes # on certain CPU subtypes. Try the ISA variant first, and if that fails, # fall back on -Wa,-dsp for the old binutils versions. Even without DSP # opcodes, we always want the best ISA tuning the version of binutils # will provide. # isaflags-y := $(call as-option,-Wa$(comma)-isa=$(isa-y),) isaflags-$(CONFIG_SH_DSP) := \ $(call as-option,-Wa$(comma)-isa=$(isa-y),-Wa$(comma)-dsp) |
5dd614761 sh: Re-add suppor... |
70 71 72 73 |
endif cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
da2f5f7bf sh: Fix DSP opcod... |
74 |
|
5dd614761 sh: Re-add suppor... |
75 |
cflags-y += $(call cc-option,-mno-fdpic) |
da2f5f7bf sh: Fix DSP opcod... |
76 |
cflags-y += $(isaflags-y) -ffreestanding |
1da177e4c Linux-2.6.12-rc2 |
77 |
|
c2f1755be sh: Tidy up KBUIL... |
78 79 |
OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ -R .stab -R .stabstr -S |
1da177e4c Linux-2.6.12-rc2 |
80 |
|
c2f1755be sh: Tidy up KBUIL... |
81 |
# Give the various platforms the opportunity to set default image types |
1a3060323 sh: sh7785lcr: Se... |
82 83 |
defaultimage-$(CONFIG_SUPERH32) := zImage defaultimage-$(CONFIG_SH_SH7785LCR) := uImage |
6f5cd2bd5 sh: mach-rsk: Use... |
84 |
defaultimage-$(CONFIG_SH_RSK) := uImage |
ae68df563 sh: Generate uIma... |
85 |
defaultimage-$(CONFIG_SH_URQUELL) := uImage |
8144a7dd5 sh: Add default u... |
86 87 |
defaultimage-$(CONFIG_SH_MIGOR) := uImage defaultimage-$(CONFIG_SH_AP325RXA) := uImage |
e857bfd46 sh: Add default u... |
88 |
defaultimage-$(CONFIG_SH_SH7757LCR) := uImage |
8144a7dd5 sh: Add default u... |
89 |
defaultimage-$(CONFIG_SH_7724_SOLUTION_ENGINE) := uImage |
709420dd4 sh: Specify sane ... |
90 91 |
defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux |
f36af7330 sh: set KBUILD_IM... |
92 |
|
c2f1755be sh: Tidy up KBUIL... |
93 |
# Set some sensible Kbuild defaults |
c2f1755be sh: Tidy up KBUIL... |
94 |
KBUILD_IMAGE := $(defaultimage-y) |
1da177e4c Linux-2.6.12-rc2 |
95 96 97 98 99 |
# # Choosing incompatible machines durings configuration will result in # error messages during linking. # |
b4db3aec8 sh: Fix up the _s... |
100 |
ifdef CONFIG_SUPERH32 |
f9e2b97dc sh: Add a KBUILD_... |
101 102 103 104 |
UTS_MACHINE := sh BITS := 32 LDFLAGS_vmlinux += -e _stext KBUILD_DEFCONFIG := shx3_defconfig |
b4db3aec8 sh: Fix up the _s... |
105 |
else |
f9e2b97dc sh: Add a KBUILD_... |
106 107 108 109 110 111 |
UTS_MACHINE := sh64 BITS := 64 LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ --defsym phys_stext_shmedia=phys_stext+1 \ -e phys_stext_shmedia KBUILD_DEFCONFIG := cayman_defconfig |
b4db3aec8 sh: Fix up the _s... |
112 |
endif |
1da177e4c Linux-2.6.12-rc2 |
113 114 |
ifdef CONFIG_CPU_LITTLE_ENDIAN |
7b022d07a sh: Tidy up the l... |
115 |
ld-bfd := elf32-$(UTS_MACHINE)-linux |
8e780be96 sh: Fix up link t... |
116 |
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) |
1da177e4c Linux-2.6.12-rc2 |
117 118 |
LDFLAGS += -EL else |
7b022d07a sh: Tidy up the l... |
119 |
ld-bfd := elf32-$(UTS_MACHINE)big-linux |
8e780be96 sh: Fix up link t... |
120 |
LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) |
1da177e4c Linux-2.6.12-rc2 |
121 122 |
LDFLAGS += -EB endif |
b20883562 sh: Provide a BIT... |
123 |
export ld-bfd BITS |
7b022d07a sh: Tidy up the l... |
124 |
|
41fe22f65 sh: Use generic i... |
125 |
head-y := arch/sh/kernel/head_$(BITS).o |
1da177e4c Linux-2.6.12-rc2 |
126 |
|
c8b5d9dcb sh: Move out indi... |
127 |
core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
4b565680d sh: math-emu support |
128 |
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
1da177e4c Linux-2.6.12-rc2 |
129 |
|
c8b5d9dcb sh: Move out indi... |
130 |
# Mach groups |
939a24a6d sh: Move out the ... |
131 |
machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se |
da2014a2b sh: Shuffle the b... |
132 133 134 |
machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx machdir-$(CONFIG_SH_DREAMCAST) += mach-dreamcast machdir-$(CONFIG_SH_SH03) += mach-sh03 |
da2014a2b sh: Shuffle the b... |
135 |
machdir-$(CONFIG_SH_RTS7751R2D) += mach-r2d |
da2014a2b sh: Shuffle the b... |
136 137 |
machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander machdir-$(CONFIG_SH_MIGOR) += mach-migor |
53528928d sh: Move ap325rxa... |
138 |
machdir-$(CONFIG_SH_AP325RXA) += mach-ap325rxa |
e7d165146 sh: kfr2r09 board... |
139 |
machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09 |
4138b7406 sh: Add EcoVec (S... |
140 |
machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24 |
da2014a2b sh: Shuffle the b... |
141 |
machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780 |
02bf6cc72 sh: Preliminary S... |
142 |
machdir-$(CONFIG_SH_SDK7786) += mach-sdk7786 |
da2014a2b sh: Shuffle the b... |
143 |
machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto |
da2014a2b sh: Shuffle the b... |
144 |
machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp |
da2014a2b sh: Shuffle the b... |
145 146 |
machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev machdir-$(CONFIG_SH_LANDISK) += mach-landisk |
da2014a2b sh: Shuffle the b... |
147 |
machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 |
da2014a2b sh: Shuffle the b... |
148 |
machdir-$(CONFIG_SH_CAYMAN) += mach-cayman |
ea0aac1e1 sh: Consolidate r... |
149 |
machdir-$(CONFIG_SH_RSK) += mach-rsk |
25f8151bd sh: Get multiple ... |
150 |
|
1da177e4c Linux-2.6.12-rc2 |
151 |
ifneq ($(machdir-y),) |
25f8151bd sh: Get multiple ... |
152 153 |
core-y += $(addprefix arch/sh/boards/, \ $(filter-out ., $(patsubst %,%/,$(machdir-y)))) |
1da177e4c Linux-2.6.12-rc2 |
154 |
endif |
7639a4541 sh: Migrate commo... |
155 156 |
# Common machine type headers. Not part of the arch/sh/boards/ hierarchy. machdir-y += mach-common |
1da177e4c Linux-2.6.12-rc2 |
157 |
# Companion chips |
4aafae27d sh: hd64461 tidying. |
158 |
core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ |
1da177e4c Linux-2.6.12-rc2 |
159 |
|
93dc544cf sh: Provide commo... |
160 161 162 163 164 165 166 167 168 169 170 171 172 |
# # CPU header paths # # These are ordered by optimization level. A CPU family that is a subset # of another (ie, SH-2A / SH-2), is picked up first, with increasing # levels of genericness if nothing more suitable is situated in the # hierarchy. # # As an example, in order of preference, SH-2A > SH-2 > common definitions. # cpuincdir-$(CONFIG_CPU_SH2A) += cpu-sh2a cpuincdir-$(CONFIG_CPU_SH2) += cpu-sh2 cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3 |
61a6976bf serial: sh-sci: A... |
173 |
cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a |
93dc544cf sh: Provide commo... |
174 175 176 |
cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 cpuincdir-y += cpu-common # Must be last |
1da177e4c Linux-2.6.12-rc2 |
177 |
|
1da177e4c Linux-2.6.12-rc2 |
178 179 180 181 |
drivers-y += arch/sh/drivers/ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ boot := arch/sh/boot |
93dc544cf sh: Provide commo... |
182 183 |
cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \ $(foreach d, $(machdir-y), -Iarch/sh/include/$(d)) |
1da177e4c Linux-2.6.12-rc2 |
184 |
|
f15cbe6f1 sh: migrate to ar... |
185 186 187 |
KBUILD_CFLAGS += -pipe $(cflags-y) KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) |
1da177e4c Linux-2.6.12-rc2 |
188 |
|
473d1cf4e sh: Decouple mcou... |
189 190 191 |
ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg endif |
bd353861c sh: dwarf unwinde... |
192 193 194 |
ifeq ($(CONFIG_DWARF_UNWINDER),y) KBUILD_CFLAGS += -fasynchronous-unwind-tables endif |
5d920bb92 sh: initial stack... |
195 196 197 |
ifeq ($(CONFIG_CC_STACKPROTECTOR),y) KBUILD_CFLAGS += -fstack-protector endif |
49de935c1 sh: fix LIBGCC |
198 |
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
180ae2037 sh: Provide sdivs... |
199 |
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
49de935c1 sh: fix LIBGCC |
200 |
|
50cfa79dc sh: support XZ-co... |
201 |
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \ |
eca50f14b sh: Add a vmlinux... |
202 203 |
uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \ romImage |
3252b11fc sh: move machtype... |
204 |
PHONY += $(BOOT_TARGETS) |
1da177e4c Linux-2.6.12-rc2 |
205 |
|
c2f1755be sh: Tidy up KBUIL... |
206 |
all: $(KBUILD_IMAGE) |
1da177e4c Linux-2.6.12-rc2 |
207 |
|
ef9b542fc sh: bzip2/lzma uI... |
208 |
$(BOOT_TARGETS): vmlinux |
1da177e4c Linux-2.6.12-rc2 |
209 210 211 |
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ compressed: zImage |
3252b11fc sh: move machtype... |
212 213 |
archprepare: $(Q)$(MAKE) $(build)=arch/sh/tools include/generated/machtypes.h |
d088f3235 sh: Consolidate s... |
214 |
|
1da177e4c Linux-2.6.12-rc2 |
215 216 |
archclean: $(Q)$(MAKE) $(clean)=$(boot) |
c1d0d32a6 sh: plug vsyscall... |
217 |
$(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall |
1da177e4c Linux-2.6.12-rc2 |
218 |
|
1da177e4c Linux-2.6.12-rc2 |
219 |
define archhelp |
ef9b542fc sh: bzip2/lzma uI... |
220 |
@echo ' zImage - Compressed kernel image' |
fdeb076f2 sh: Add romImage ... |
221 |
@echo ' romImage - Compressed ROM image, if supported' |
cf00e2044 sh: Add uImage an... |
222 |
@echo ' vmlinux.srec - Create an ELF S-record' |
eca50f14b sh: Add a vmlinux... |
223 |
@echo ' vmlinux.bin - Create an uncompressed binary image' |
ef9b542fc sh: bzip2/lzma uI... |
224 225 |
@echo '* uImage - Alias to bootable U-Boot image' @echo ' uImage.srec - Create an S-record for U-Boot' |
a5c461bb3 sh: Document uIma... |
226 |
@echo ' uImage.bin - Kernel-only image for U-Boot (bin)' |
ef9b542fc sh: bzip2/lzma uI... |
227 228 229 |
@echo '* uImage.gz - Kernel-only image for U-Boot (gzip)' @echo ' uImage.bz2 - Kernel-only image for U-Boot (bzip2)' @echo ' uImage.lzma - Kernel-only image for U-Boot (lzma)' |
50cfa79dc sh: support XZ-co... |
230 |
@echo ' uImage.xz - Kernel-only image for U-Boot (xz)' |
c7b16efb7 sh: Add support f... |
231 |
@echo ' uImage.lzo - Kernel-only image for U-Boot (lzo)' |
1da177e4c Linux-2.6.12-rc2 |
232 |
endef |