Blame view
arch/sh/Makefile
7.7 KB
1da177e4c
|
1 |
# |
c2f1755be
|
2 |
# arch/sh/Makefile |
1da177e4c
|
3 4 |
# # Copyright (C) 1999 Kaz Kojima |
b2d86a3fd
|
5 |
# Copyright (C) 2002 - 2008 Paul Mundt |
1da177e4c
|
6 7 |
# Copyright (C) 2002 M. R. Brown # |
c2f1755be
|
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
|
11 |
# |
cad824484
|
12 |
isa-y := any |
e5723e0ee
|
13 |
isa-$(CONFIG_SH_DSP) := sh |
cad824484
|
14 |
isa-$(CONFIG_CPU_SH2) := sh2 |
e5723e0ee
|
15 |
isa-$(CONFIG_CPU_SH2A) := sh2a |
cad824484
|
16 17 18 |
isa-$(CONFIG_CPU_SH3) := sh3 isa-$(CONFIG_CPU_SH4) := sh4 isa-$(CONFIG_CPU_SH4A) := sh4a |
e5723e0ee
|
19 |
isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al |
c20c20047
|
20 |
isa-$(CONFIG_CPU_SH5) := shmedia |
ddb72b024
|
21 22 |
ifeq ($(CONFIG_SUPERH32),y) |
cad824484
|
23 |
isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp |
ddb72b024
|
24 25 |
isa-y := $(isa-y)-up endif |
cad824484
|
26 |
|
6240d92f2
|
27 |
cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) |
aab1b16a6
|
28 |
cflags-$(CONFIG_CPU_SH2A) += $(call cc-option,-m2a,) \ |
6240d92f2
|
29 30 31 |
$(call cc-option,-m2a-nofpu,) cflags-$(CONFIG_CPU_SH3) := $(call cc-option,-m3,) cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ |
1da177e4c
|
32 |
$(call cc-option,-mno-implicit-fp,-m4-nofpu) |
aab1b16a6
|
33 |
cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
6240d92f2
|
34 |
$(call cc-option,-m4a-nofpu,) |
8bcc5c1c3
|
35 |
cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) |
c20c20047
|
36 |
cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
53644087a
|
37 |
|
5dd614761
|
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
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
|
53 54 55 56 57 58 59 60 61 62 63 64 |
# # -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
|
65 66 67 68 |
endif cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
da2f5f7bf
|
69 |
|
5dd614761
|
70 |
cflags-y += $(call cc-option,-mno-fdpic) |
da2f5f7bf
|
71 |
cflags-y += $(isaflags-y) -ffreestanding |
1da177e4c
|
72 |
|
c2f1755be
|
73 74 |
OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ -R .stab -R .stabstr -S |
1da177e4c
|
75 |
|
c2f1755be
|
76 |
# Give the various platforms the opportunity to set default image types |
1a3060323
|
77 78 |
defaultimage-$(CONFIG_SUPERH32) := zImage defaultimage-$(CONFIG_SH_SH7785LCR) := uImage |
6f5cd2bd5
|
79 |
defaultimage-$(CONFIG_SH_RSK) := uImage |
ae68df563
|
80 |
defaultimage-$(CONFIG_SH_URQUELL) := uImage |
709420dd4
|
81 82 |
defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux |
f36af7330
|
83 |
|
c2f1755be
|
84 |
# Set some sensible Kbuild defaults |
c2f1755be
|
85 |
KBUILD_IMAGE := $(defaultimage-y) |
1da177e4c
|
86 87 88 89 90 |
# # Choosing incompatible machines durings configuration will result in # error messages during linking. # |
b4db3aec8
|
91 |
ifdef CONFIG_SUPERH32 |
f9e2b97dc
|
92 93 94 95 |
UTS_MACHINE := sh BITS := 32 LDFLAGS_vmlinux += -e _stext KBUILD_DEFCONFIG := shx3_defconfig |
b4db3aec8
|
96 |
else |
f9e2b97dc
|
97 98 99 100 101 102 |
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
|
103 |
endif |
1da177e4c
|
104 |
|
457daa2b6
|
105 106 107 108 109 |
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 |
1da177e4c
|
110 |
ifdef CONFIG_CPU_LITTLE_ENDIAN |
7b022d07a
|
111 112 |
ld-bfd := elf32-$(UTS_MACHINE)-linux LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd) |
1da177e4c
|
113 114 |
LDFLAGS += -EL else |
7b022d07a
|
115 116 |
ld-bfd := elf32-$(UTS_MACHINE)big-linux LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd) |
1da177e4c
|
117 118 |
LDFLAGS += -EB endif |
b20883562
|
119 |
export ld-bfd BITS |
7b022d07a
|
120 |
|
b20883562
|
121 |
head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o |
1da177e4c
|
122 |
|
c8b5d9dcb
|
123 |
core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
4b565680d
|
124 |
core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
1da177e4c
|
125 |
|
c8b5d9dcb
|
126 |
# Mach groups |
939a24a6d
|
127 |
machdir-$(CONFIG_SOLUTION_ENGINE) += mach-se |
da2014a2b
|
128 129 130 131 132 133 134 135 136 |
machdir-$(CONFIG_SH_HP6XX) += mach-hp6xx machdir-$(CONFIG_SH_DREAMCAST) += mach-dreamcast machdir-$(CONFIG_SH_SH03) += mach-sh03 machdir-$(CONFIG_SH_SECUREEDGE5410) += mach-snapgear machdir-$(CONFIG_SH_RTS7751R2D) += mach-r2d machdir-$(CONFIG_SH_7751_SYSTEMH) += mach-systemh machdir-$(CONFIG_SH_EDOSK7705) += mach-edosk7705 machdir-$(CONFIG_SH_HIGHLANDER) += mach-highlander machdir-$(CONFIG_SH_MIGOR) += mach-migor |
e7d165146
|
137 |
machdir-$(CONFIG_SH_KFR2R09) += mach-kfr2r09 |
4138b7406
|
138 |
machdir-$(CONFIG_SH_ECOVEC) += mach-ecovec24 |
da2014a2b
|
139 140 |
machdir-$(CONFIG_SH_SDK7780) += mach-sdk7780 machdir-$(CONFIG_SH_X3PROTO) += mach-x3proto |
da2014a2b
|
141 |
machdir-$(CONFIG_SH_SH7763RDP) += mach-sh7763rdp |
da2014a2b
|
142 143 144 |
machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev machdir-$(CONFIG_SH_LANDISK) += mach-landisk machdir-$(CONFIG_SH_TITAN) += mach-titan |
da2014a2b
|
145 |
machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 |
da2014a2b
|
146 |
machdir-$(CONFIG_SH_CAYMAN) += mach-cayman |
ea0aac1e1
|
147 |
machdir-$(CONFIG_SH_RSK) += mach-rsk |
25f8151bd
|
148 |
|
1da177e4c
|
149 |
ifneq ($(machdir-y),) |
25f8151bd
|
150 151 |
core-y += $(addprefix arch/sh/boards/, \ $(filter-out ., $(patsubst %,%/,$(machdir-y)))) |
1da177e4c
|
152 |
endif |
7639a4541
|
153 154 |
# Common machine type headers. Not part of the arch/sh/boards/ hierarchy. machdir-y += mach-common |
1da177e4c
|
155 |
# Companion chips |
4aafae27d
|
156 |
core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ |
1da177e4c
|
157 |
|
93dc544cf
|
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# # 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 cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 cpuincdir-y += cpu-common # Must be last |
1da177e4c
|
174 |
|
1da177e4c
|
175 176 177 178 |
drivers-y += arch/sh/drivers/ drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ boot := arch/sh/boot |
93dc544cf
|
179 180 |
cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \ $(foreach d, $(machdir-y), -Iarch/sh/include/$(d)) |
1da177e4c
|
181 |
|
f15cbe6f1
|
182 183 184 |
KBUILD_CFLAGS += -pipe $(cflags-y) KBUILD_CPPFLAGS += $(cflags-y) KBUILD_AFLAGS += $(cflags-y) |
1da177e4c
|
185 |
|
473d1cf4e
|
186 187 188 |
ifeq ($(CONFIG_MCOUNT),y) KBUILD_CFLAGS += -pg endif |
bd353861c
|
189 190 191 |
ifeq ($(CONFIG_DWARF_UNWINDER),y) KBUILD_CFLAGS += -fasynchronous-unwind-tables endif |
49de935c1
|
192 |
libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
180ae2037
|
193 |
libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
49de935c1
|
194 |
|
9e24c7e2a
|
195 |
BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.srec uImage.bin \ |
3c928320b
|
196 |
zImage vmlinux.srec romImage |
ef9b542fc
|
197 |
PHONY += maketools $(BOOT_TARGETS) FORCE |
d088f3235
|
198 |
|
cca6e6f5f
|
199 |
maketools: include/linux/version.h FORCE |
4385e12b2
|
200 |
$(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h |
1da177e4c
|
201 |
|
c2f1755be
|
202 |
all: $(KBUILD_IMAGE) |
1da177e4c
|
203 |
|
ef9b542fc
|
204 |
$(BOOT_TARGETS): vmlinux |
1da177e4c
|
205 206 207 |
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ compressed: zImage |
cb3a86c89
|
208 |
archprepare: maketools |
d088f3235
|
209 |
|
1da177e4c
|
210 211 |
archclean: $(Q)$(MAKE) $(clean)=$(boot) |
c1d0d32a6
|
212 |
$(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall |
1da177e4c
|
213 |
|
1da177e4c
|
214 |
define archhelp |
ef9b542fc
|
215 |
@echo ' zImage - Compressed kernel image' |
fdeb076f2
|
216 |
@echo ' romImage - Compressed ROM image, if supported' |
cf00e2044
|
217 |
@echo ' vmlinux.srec - Create an ELF S-record' |
ef9b542fc
|
218 219 |
@echo '* uImage - Alias to bootable U-Boot image' @echo ' uImage.srec - Create an S-record for U-Boot' |
a5c461bb3
|
220 |
@echo ' uImage.bin - Kernel-only image for U-Boot (bin)' |
ef9b542fc
|
221 222 223 |
@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)' |
1da177e4c
|
224 |
endef |
d088f3235
|
225 |
|
cb3a86c89
|
226 |
CLEAN_FILES += include/asm-sh/machtypes.h |