| .. | .. |
|---|
| 11 | 11 | # |
|---|
| 12 | 12 | ifneq ($(SUBARCH),$(ARCH)) |
|---|
| 13 | 13 | ifeq ($(CROSS_COMPILE),) |
|---|
| 14 | | - CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-) |
|---|
| 14 | + CROSS_COMPILE := $(call cc-cross-prefix, sh-linux- sh-linux-gnu- sh-unknown-linux-gnu-) |
|---|
| 15 | 15 | endif |
|---|
| 16 | 16 | endif |
|---|
| 17 | 17 | |
|---|
| 18 | | -ifeq ($(ARCH),sh) |
|---|
| 19 | 18 | KBUILD_DEFCONFIG := shx3_defconfig |
|---|
| 20 | | -else |
|---|
| 21 | | -KBUILD_DEFCONFIG := cayman_defconfig |
|---|
| 22 | | -endif |
|---|
| 23 | 19 | |
|---|
| 24 | 20 | isa-y := any |
|---|
| 25 | 21 | isa-$(CONFIG_SH_DSP) := sh |
|---|
| .. | .. |
|---|
| 29 | 25 | isa-$(CONFIG_CPU_SH4) := sh4 |
|---|
| 30 | 26 | isa-$(CONFIG_CPU_SH4A) := sh4a |
|---|
| 31 | 27 | isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al |
|---|
| 32 | | -isa-$(CONFIG_CPU_SH5) := shmedia |
|---|
| 33 | 28 | |
|---|
| 34 | | -ifeq ($(CONFIG_SUPERH32),y) |
|---|
| 35 | 29 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp |
|---|
| 36 | 30 | isa-y := $(isa-y)-up |
|---|
| 37 | | -endif |
|---|
| 38 | 31 | |
|---|
| 39 | 32 | cflags-$(CONFIG_CPU_SH2) := $(call cc-option,-m2,) |
|---|
| 40 | 33 | cflags-$(CONFIG_CPU_J2) += $(call cc-option,-mj2,) |
|---|
| .. | .. |
|---|
| 47 | 40 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
|---|
| 48 | 41 | $(call cc-option,-m4a-nofpu,) |
|---|
| 49 | 42 | cflags-$(CONFIG_CPU_SH4AL_DSP) += $(call cc-option,-m4al,) |
|---|
| 50 | | -cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) |
|---|
| 51 | 43 | |
|---|
| 52 | 44 | ifeq ($(cflags-y),) |
|---|
| 53 | 45 | # |
|---|
| .. | .. |
|---|
| 88 | 80 | -R .stab -R .stabstr -S |
|---|
| 89 | 81 | |
|---|
| 90 | 82 | # Give the various platforms the opportunity to set default image types |
|---|
| 91 | | -defaultimage-$(CONFIG_SUPERH32) := zImage |
|---|
| 83 | +defaultimage-y := zImage |
|---|
| 92 | 84 | defaultimage-$(CONFIG_SH_SH7785LCR) := uImage |
|---|
| 93 | 85 | defaultimage-$(CONFIG_SH_RSK) := uImage |
|---|
| 94 | 86 | defaultimage-$(CONFIG_SH_URQUELL) := uImage |
|---|
| .. | .. |
|---|
| 107 | 99 | # Choosing incompatible machines durings configuration will result in |
|---|
| 108 | 100 | # error messages during linking. |
|---|
| 109 | 101 | # |
|---|
| 110 | | -ifdef CONFIG_SUPERH32 |
|---|
| 111 | 102 | UTS_MACHINE := sh |
|---|
| 112 | | -BITS := 32 |
|---|
| 113 | 103 | LDFLAGS_vmlinux += -e _stext |
|---|
| 114 | | -else |
|---|
| 115 | | -UTS_MACHINE := sh64 |
|---|
| 116 | | -BITS := 64 |
|---|
| 117 | | -LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ |
|---|
| 118 | | - --defsym phys_stext_shmedia=phys_stext+1 \ |
|---|
| 119 | | - -e phys_stext_shmedia |
|---|
| 120 | | -endif |
|---|
| 121 | 104 | |
|---|
| 122 | 105 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
|---|
| 123 | | -ld-bfd := elf32-$(UTS_MACHINE)-linux |
|---|
| 106 | +ld-bfd := elf32-sh-linux |
|---|
| 124 | 107 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64 --oformat $(ld-bfd) |
|---|
| 125 | 108 | KBUILD_LDFLAGS += -EL |
|---|
| 126 | 109 | else |
|---|
| 127 | | -ld-bfd := elf32-$(UTS_MACHINE)big-linux |
|---|
| 110 | +ld-bfd := elf32-shbig-linux |
|---|
| 128 | 111 | LDFLAGS_vmlinux += --defsym jiffies=jiffies_64+4 --oformat $(ld-bfd) |
|---|
| 129 | 112 | KBUILD_LDFLAGS += -EB |
|---|
| 130 | 113 | endif |
|---|
| 131 | 114 | |
|---|
| 132 | | -export ld-bfd BITS |
|---|
| 115 | +export ld-bfd |
|---|
| 133 | 116 | |
|---|
| 134 | | -head-y := arch/sh/kernel/head_$(BITS).o |
|---|
| 117 | +head-y := arch/sh/kernel/head_32.o |
|---|
| 135 | 118 | |
|---|
| 136 | 119 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
|---|
| 137 | 120 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
|---|
| .. | .. |
|---|
| 156 | 139 | machdir-$(CONFIG_SH_SH4202_MICRODEV) += mach-microdev |
|---|
| 157 | 140 | machdir-$(CONFIG_SH_LANDISK) += mach-landisk |
|---|
| 158 | 141 | machdir-$(CONFIG_SH_LBOX_RE2) += mach-lboxre2 |
|---|
| 159 | | -machdir-$(CONFIG_SH_CAYMAN) += mach-cayman |
|---|
| 160 | 142 | machdir-$(CONFIG_SH_RSK) += mach-rsk |
|---|
| 161 | 143 | |
|---|
| 162 | 144 | ifneq ($(machdir-y),) |
|---|
| .. | .. |
|---|
| 185 | 167 | cpuincdir-$(CONFIG_CPU_SH3) += cpu-sh3 |
|---|
| 186 | 168 | cpuincdir-$(CONFIG_CPU_SH4A) += cpu-sh4a |
|---|
| 187 | 169 | cpuincdir-$(CONFIG_CPU_SH4) += cpu-sh4 |
|---|
| 188 | | -cpuincdir-$(CONFIG_CPU_SH5) += cpu-sh5 |
|---|
| 189 | 170 | cpuincdir-y += cpu-common # Must be last |
|---|
| 190 | 171 | |
|---|
| 191 | 172 | drivers-y += arch/sh/drivers/ |
|---|
| 192 | 173 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ |
|---|
| 193 | 174 | |
|---|
| 194 | | -cflags-y += $(foreach d, $(cpuincdir-y), -Iarch/sh/include/$(d)) \ |
|---|
| 195 | | - $(foreach d, $(machdir-y), -Iarch/sh/include/$(d)) |
|---|
| 175 | +cflags-y += $(foreach d, $(cpuincdir-y), -I $(srctree)/arch/sh/include/$(d)) \ |
|---|
| 176 | + $(foreach d, $(machdir-y), -I $(srctree)/arch/sh/include/$(d)) |
|---|
| 196 | 177 | |
|---|
| 197 | 178 | KBUILD_CFLAGS += -pipe $(cflags-y) |
|---|
| 198 | 179 | KBUILD_CPPFLAGS += $(cflags-y) |
|---|
| .. | .. |
|---|
| 206 | 187 | KBUILD_CFLAGS += -fasynchronous-unwind-tables |
|---|
| 207 | 188 | endif |
|---|
| 208 | 189 | |
|---|
| 209 | | -libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
|---|
| 210 | | -libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) |
|---|
| 190 | +libs-y := arch/sh/lib/ $(libs-y) |
|---|
| 211 | 191 | |
|---|
| 212 | 192 | BOOT_TARGETS = uImage uImage.bz2 uImage.gz uImage.lzma uImage.xz uImage.lzo \ |
|---|
| 213 | 193 | uImage.srec uImage.bin zImage vmlinux.bin vmlinux.srec \ |
|---|
| .. | .. |
|---|
| 228 | 208 | $(Q)$(MAKE) $(clean)=$(boot) |
|---|
| 229 | 209 | $(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall |
|---|
| 230 | 210 | |
|---|
| 211 | +archheaders: |
|---|
| 212 | + $(Q)$(MAKE) $(build)=arch/sh/kernel/syscalls all |
|---|
| 213 | + |
|---|
| 231 | 214 | define archhelp |
|---|
| 232 | 215 | @echo ' zImage - Compressed kernel image' |
|---|
| 233 | 216 | @echo ' romImage - Compressed ROM image, if supported' |
|---|