diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 57 |
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 | |||
70 | cflags-y += $(call cc-option,-mno-fdpic) | 70 | cflags-y += $(call cc-option,-mno-fdpic) |
71 | cflags-y += $(isaflags-y) -ffreestanding | 71 | cflags-y += $(isaflags-y) -ffreestanding |
72 | 72 | ||
73 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | ||
74 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') | ||
75 | |||
76 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ | 73 | OBJCOPYFLAGS := -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 | # |
95 | ifdef CONFIG_SUPERH32 | 92 | ifdef CONFIG_SUPERH32 |
96 | UTS_MACHINE := sh | 93 | UTS_MACHINE := sh |
94 | BITS := 32 | ||
97 | LDFLAGS_vmlinux += -e _stext | 95 | LDFLAGS_vmlinux += -e _stext |
98 | else | 96 | else |
99 | UTS_MACHINE := sh64 | 97 | UTS_MACHINE := sh64 |
98 | BITS := 64 | ||
100 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | 99 | LDFLAGS_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 |
103 | endif | 102 | endif |
104 | 103 | ||
104 | ifneq ($(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 | ||
108 | endif | ||
109 | |||
105 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 110 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
106 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | 111 | ld-bfd := elf32-$(UTS_MACHINE)-linux |
112 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd) | ||
107 | LDFLAGS += -EL | 113 | LDFLAGS += -EL |
108 | else | 114 | else |
109 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' | 115 | ld-bfd := elf32-$(UTS_MACHINE)big-linux |
116 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd) | ||
110 | LDFLAGS += -EB | 117 | LDFLAGS += -EB |
111 | endif | 118 | endif |
112 | 119 | ||
113 | head-y := arch/sh/kernel/init_task.o | 120 | export ld-bfd BITS |
114 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | 121 | |
115 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | 122 | head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o |
116 | 123 | ||
117 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ | 124 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
118 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ | 125 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
@@ -193,7 +200,7 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux | |||
193 | 200 | ||
194 | compressed: zImage | 201 | compressed: zImage |
195 | 202 | ||
196 | archprepare: maketools arch/sh/lib64/syscalltab.h | 203 | archprepare: maketools |
197 | 204 | ||
198 | archclean: | 205 | archclean: |
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' |
206 | endef | 213 | endef |
207 | 214 | ||
208 | define filechk_gen-syscalltab | 215 | CLEAN_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 */" ) | ||
232 | endef | ||
233 | |||
234 | arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S | ||
235 | $(call filechk,gen-syscalltab) | ||
236 | |||
237 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ | ||
238 | include/asm-sh/machtypes.h | ||