aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile73
1 files changed, 26 insertions, 47 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index bece1f7535f2..75d049b03f7e 100644
--- a/arch/sh/Makefile
+++ b/arch/sh/Makefile
@@ -70,9 +70,6 @@ cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
70cflags-y += $(call cc-option,-mno-fdpic) 70cflags-y += $(call cc-option,-mno-fdpic)
71cflags-y += $(isaflags-y) -ffreestanding 71cflags-y += $(isaflags-y) -ffreestanding
72 72
73cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \
74 $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
75
76OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ 73OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \
77 -R .stab -R .stabstr -S 74 -R .stab -R .stabstr -S
78 75
@@ -85,7 +82,6 @@ defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux
85defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux 82defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux
86 83
87# Set some sensible Kbuild defaults 84# Set some sensible Kbuild defaults
88KBUILD_DEFCONFIG := shx3_defconfig
89KBUILD_IMAGE := $(defaultimage-y) 85KBUILD_IMAGE := $(defaultimage-y)
90 86
91# 87#
@@ -93,26 +89,38 @@ KBUILD_IMAGE := $(defaultimage-y)
93# error messages during linking. 89# error messages during linking.
94# 90#
95ifdef CONFIG_SUPERH32 91ifdef CONFIG_SUPERH32
96UTS_MACHINE := sh 92UTS_MACHINE := sh
97LDFLAGS_vmlinux += -e _stext 93BITS := 32
94LDFLAGS_vmlinux += -e _stext
95KBUILD_DEFCONFIG := shx3_defconfig
98else 96else
99UTS_MACHINE := sh64 97UTS_MACHINE := sh64
100LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ 98BITS := 64
101 --defsym phys_stext_shmedia=phys_stext+1 \ 99LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
102 -e phys_stext_shmedia 100 --defsym phys_stext_shmedia=phys_stext+1 \
101 -e phys_stext_shmedia
102KBUILD_DEFCONFIG := cayman_defconfig
103endif
104
105ifneq ($(SUBARCH),$(ARCH))
106 ifeq ($(CROSS_COMPILE),)
107 CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
108 endif
103endif 109endif
104 110
105ifdef CONFIG_CPU_LITTLE_ENDIAN 111ifdef CONFIG_CPU_LITTLE_ENDIAN
106LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' 112ld-bfd := elf32-$(UTS_MACHINE)-linux
113LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
107LDFLAGS += -EL 114LDFLAGS += -EL
108else 115else
109LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' 116ld-bfd := elf32-$(UTS_MACHINE)big-linux
117LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd)
110LDFLAGS += -EB 118LDFLAGS += -EB
111endif 119endif
112 120
113head-y := arch/sh/kernel/init_task.o 121export ld-bfd BITS
114head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o 122
115head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o 123head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o
116 124
117core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ 125core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
118core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ 126core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
@@ -193,10 +201,11 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux
193 201
194compressed: zImage 202compressed: zImage
195 203
196archprepare: maketools arch/sh/lib64/syscalltab.h 204archprepare: maketools
197 205
198archclean: 206archclean:
199 $(Q)$(MAKE) $(clean)=$(boot) 207 $(Q)$(MAKE) $(clean)=$(boot)
208 $(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall
200 209
201define archhelp 210define archhelp
202 @echo '* zImage - Compressed kernel image' 211 @echo '* zImage - Compressed kernel image'
@@ -205,34 +214,4 @@ define archhelp
205 @echo ' uImage.srec - Create an S-record for U-Boot' 214 @echo ' uImage.srec - Create an S-record for U-Boot'
206endef 215endef
207 216
208define filechk_gen-syscalltab 217CLEAN_FILES += include/asm-sh/machtypes.h
209 (set -e; \
210 echo "/*"; \
211 echo " * DO NOT MODIFY."; \
212 echo " *"; \
213 echo " * This file was generated by arch/sh/Makefile"; \
214 echo " * Any changes will be reverted at build time."; \
215 echo " */"; \
216 echo ""; \
217 echo "#ifndef __SYSCALLTAB_H"; \
218 echo "#define __SYSCALLTAB_H"; \
219 echo ""; \
220 echo "#include <linux/kernel.h>"; \
221 echo ""; \
222 echo "struct syscall_info {"; \
223 echo " const char *name;"; \
224 echo "} syscall_info_table[] = {"; \
225 sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \
226 s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \
227 echo "};"; \
228 echo ""; \
229 echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)";\
230 echo ""; \
231 echo "#endif /* __SYSCALLTAB_H */" )
232endef
233
234arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S
235 $(call filechk,gen-syscalltab)
236
237CLEAN_FILES += arch/sh/lib64/syscalltab.h \
238 include/asm-sh/machtypes.h