aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile57
1 files changed, 17 insertions, 40 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile
index bece1f7535f2..a47fbd260ba4 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
@@ -94,25 +91,35 @@ KBUILD_IMAGE := $(defaultimage-y)
94# 91#
95ifdef CONFIG_SUPERH32 92ifdef CONFIG_SUPERH32
96UTS_MACHINE := sh 93UTS_MACHINE := sh
94BITS := 32
97LDFLAGS_vmlinux += -e _stext 95LDFLAGS_vmlinux += -e _stext
98else 96else
99UTS_MACHINE := sh64 97UTS_MACHINE := sh64
98BITS := 64
100LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ 99LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
101 --defsym phys_stext_shmedia=phys_stext+1 \ 100 --defsym phys_stext_shmedia=phys_stext+1 \
102 -e phys_stext_shmedia 101 -e phys_stext_shmedia
103endif 102endif
104 103
104ifneq ($(SUBARCH),$(ARCH))
105 ifeq ($(CROSS_COMPILE),)
106 CROSS_COMPILE := $(call cc-cross-prefix, $(UTS_MACHINE)-linux- $(UTS_MACHINE)-linux-gnu- $(UTS_MACHINE)-unknown-linux-gnu-)
107 endif
108endif
109
105ifdef CONFIG_CPU_LITTLE_ENDIAN 110ifdef CONFIG_CPU_LITTLE_ENDIAN
106LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' 111ld-bfd := elf32-$(UTS_MACHINE)-linux
112LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd)
107LDFLAGS += -EL 113LDFLAGS += -EL
108else 114else
109LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' 115ld-bfd := elf32-$(UTS_MACHINE)big-linux
116LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd)
110LDFLAGS += -EB 117LDFLAGS += -EB
111endif 118endif
112 119
113head-y := arch/sh/kernel/init_task.o 120export ld-bfd BITS
114head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o 121
115head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o 122head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o
116 123
117core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ 124core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/
118core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ 125core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/
@@ -193,7 +200,7 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux
193 200
194compressed: zImage 201compressed: zImage
195 202
196archprepare: maketools arch/sh/lib64/syscalltab.h 203archprepare: maketools
197 204
198archclean: 205archclean:
199 $(Q)$(MAKE) $(clean)=$(boot) 206 $(Q)$(MAKE) $(clean)=$(boot)
@@ -205,34 +212,4 @@ define archhelp
205 @echo ' uImage.srec - Create an S-record for U-Boot' 212 @echo ' uImage.srec - Create an S-record for U-Boot'
206endef 213endef
207 214
208define filechk_gen-syscalltab 215CLEAN_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