diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 60 |
1 files changed, 43 insertions, 17 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 67192d6b00d8..08c9515c4806 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -17,10 +17,30 @@ | |||
17 | cflags-y := -mb | 17 | cflags-y := -mb |
18 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml | 18 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml |
19 | 19 | ||
20 | isa-y := any | ||
21 | isa-$(CONFIG_CPU_SH2) := sh2 | ||
22 | isa-$(CONFIG_CPU_SH3) := sh3 | ||
23 | isa-$(CONFIG_CPU_SH4) := sh4 | ||
24 | isa-$(CONFIG_CPU_SH4A) := sh4a | ||
25 | isa-$(CONFIG_CPU_SH2A) := sh2a | ||
26 | |||
27 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp | ||
28 | |||
29 | ifndef CONFIG_MMU | ||
30 | isa-y := $(isa-y)-nommu | ||
31 | endif | ||
32 | |||
33 | ifndef CONFIG_SH_FPU | ||
34 | isa-y := $(isa-y)-nofpu | ||
35 | endif | ||
36 | |||
37 | cflags-y += $(call as-option,-Wa$(comma)-isa=$(isa-y),) | ||
38 | |||
20 | cflags-$(CONFIG_CPU_SH2) += -m2 | 39 | cflags-$(CONFIG_CPU_SH2) += -m2 |
21 | cflags-$(CONFIG_CPU_SH3) += -m3 | 40 | cflags-$(CONFIG_CPU_SH3) += -m3 |
22 | cflags-$(CONFIG_CPU_SH4) += -m4 \ | 41 | cflags-$(CONFIG_CPU_SH4) += -m4 \ |
23 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) | 42 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) |
43 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a-nofpu,) | ||
24 | 44 | ||
25 | cflags-$(CONFIG_SH_DSP) += -Wa,-dsp | 45 | cflags-$(CONFIG_SH_DSP) += -Wa,-dsp |
26 | cflags-$(CONFIG_SH_KGDB) += -g | 46 | cflags-$(CONFIG_SH_KGDB) += -g |
@@ -67,9 +87,7 @@ machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE) := se/7300 | |||
67 | machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 | 87 | machdir-$(CONFIG_SH_73180_SOLUTION_ENGINE) := se/73180 |
68 | machdir-$(CONFIG_SH_STB1_HARP) := harp | 88 | machdir-$(CONFIG_SH_STB1_HARP) := harp |
69 | machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive | 89 | machdir-$(CONFIG_SH_STB1_OVERDRIVE) := overdrive |
70 | machdir-$(CONFIG_SH_HP620) := hp6xx/hp620 | 90 | machdir-$(CONFIG_SH_HP6XX) := hp6xx |
71 | machdir-$(CONFIG_SH_HP680) := hp6xx/hp680 | ||
72 | machdir-$(CONFIG_SH_HP690) := hp6xx/hp690 | ||
73 | machdir-$(CONFIG_SH_CQREEK) := cqreek | 91 | machdir-$(CONFIG_SH_CQREEK) := cqreek |
74 | machdir-$(CONFIG_SH_DMIDA) := dmida | 92 | machdir-$(CONFIG_SH_DMIDA) := dmida |
75 | machdir-$(CONFIG_SH_EC3104) := ec3104 | 93 | machdir-$(CONFIG_SH_EC3104) := ec3104 |
@@ -119,31 +137,39 @@ boot := arch/sh/boot | |||
119 | 137 | ||
120 | CPPFLAGS_vmlinux.lds := -traditional | 138 | CPPFLAGS_vmlinux.lds := -traditional |
121 | 139 | ||
140 | ifneq ($(KBUILD_SRC),) | ||
141 | incdir-prefix := $(srctree)/include/asm-sh/ | ||
142 | else | ||
143 | incdir-prefix := | ||
144 | endif | ||
145 | |||
122 | # Update machine arch and proc symlinks if something which affects | 146 | # Update machine arch and proc symlinks if something which affects |
123 | # them changed. We use .arch and .mach to indicate when they were | 147 | # them changed. We use .arch and .mach to indicate when they were |
124 | # updated last, otherwise make uses the target directory mtime. | 148 | # updated last, otherwise make uses the target directory mtime. |
125 | 149 | ||
126 | include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/MARKER | 150 | include/asm-sh/.cpu: $(wildcard include/config/cpu/*.h) include/config/MARKER |
127 | @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)' | 151 | @echo ' SYMLINK include/asm-sh/cpu -> include/asm-sh/$(cpuincdir-y)' |
128 | ifneq ($(KBUILD_SRC),) | 152 | $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi |
129 | $(Q)mkdir -p include/asm-sh | 153 | $(Q)ln -fsn $(incdir-prefix)$(cpuincdir-y) include/asm-sh/cpu |
130 | $(Q)ln -fsn $(srctree)/include/asm-sh/$(cpuincdir-y) include/asm-sh/cpu | ||
131 | else | ||
132 | $(Q)ln -fsn $(cpuincdir-y) include/asm-sh/cpu | ||
133 | endif | ||
134 | @touch $@ | 154 | @touch $@ |
135 | 155 | ||
156 | # Most boards have their own mach directories. For the ones that | ||
157 | # don't, just reference the parent directory so the semantics are | ||
158 | # kept roughly the same. | ||
159 | |||
136 | include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER | 160 | include/asm-sh/.mach: $(wildcard include/config/sh/*.h) include/config/MARKER |
137 | @echo ' SYMLINK include/asm-sh/mach -> include/asm-sh/$(incdir-y)' | 161 | @echo -n ' SYMLINK include/asm-sh/mach -> ' |
138 | ifneq ($(KBUILD_SRC),) | 162 | $(Q)if [ ! -d include/asm-sh ]; then mkdir -p include/asm-sh; fi |
139 | $(Q)mkdir -p include/asm-sh | 163 | $(Q)if [ -d $(incdir-prefix)$(incdir-y) ]; then \ |
140 | $(Q)ln -fsn $(srctree)/include/asm-sh/$(incdir-y) include/asm-sh/mach | 164 | echo -e 'include/asm-sh/$(incdir-y)'; \ |
141 | else | 165 | ln -fsn $(incdir-prefix)$(incdir-y) \ |
142 | $(Q)ln -fsn $(incdir-y) include/asm-sh/mach | 166 | include/asm-sh/mach; \ |
143 | endif | 167 | else \ |
168 | echo -e 'include/asm-sh'; \ | ||
169 | ln -fsn $(incdir-prefix) include/asm-sh/mach; \ | ||
170 | fi | ||
144 | @touch $@ | 171 | @touch $@ |
145 | 172 | ||
146 | |||
147 | archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach | 173 | archprepare: maketools include/asm-sh/.cpu include/asm-sh/.mach |
148 | 174 | ||
149 | .PHONY: maketools FORCE | 175 | .PHONY: maketools FORCE |