diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 73 |
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 | |||
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 | ||
@@ -85,7 +82,6 @@ defaultimage-$(CONFIG_SH_7206_SOLUTION_ENGINE) := vmlinux | |||
85 | defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux | 82 | defaultimage-$(CONFIG_SH_7619_SOLUTION_ENGINE) := vmlinux |
86 | 83 | ||
87 | # Set some sensible Kbuild defaults | 84 | # Set some sensible Kbuild defaults |
88 | KBUILD_DEFCONFIG := shx3_defconfig | ||
89 | KBUILD_IMAGE := $(defaultimage-y) | 85 | KBUILD_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 | # |
95 | ifdef CONFIG_SUPERH32 | 91 | ifdef CONFIG_SUPERH32 |
96 | UTS_MACHINE := sh | 92 | UTS_MACHINE := sh |
97 | LDFLAGS_vmlinux += -e _stext | 93 | BITS := 32 |
94 | LDFLAGS_vmlinux += -e _stext | ||
95 | KBUILD_DEFCONFIG := shx3_defconfig | ||
98 | else | 96 | else |
99 | UTS_MACHINE := sh64 | 97 | UTS_MACHINE := sh64 |
100 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | 98 | BITS := 64 |
101 | --defsym phys_stext_shmedia=phys_stext+1 \ | 99 | LDFLAGS_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 | ||
102 | KBUILD_DEFCONFIG := cayman_defconfig | ||
103 | endif | ||
104 | |||
105 | ifneq ($(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 | ||
103 | endif | 109 | endif |
104 | 110 | ||
105 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 111 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
106 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | 112 | ld-bfd := elf32-$(UTS_MACHINE)-linux |
113 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' --oformat $(ld-bfd) | ||
107 | LDFLAGS += -EL | 114 | LDFLAGS += -EL |
108 | else | 115 | else |
109 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' | 116 | ld-bfd := elf32-$(UTS_MACHINE)big-linux |
117 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' --oformat $(ld-bfd) | ||
110 | LDFLAGS += -EB | 118 | LDFLAGS += -EB |
111 | endif | 119 | endif |
112 | 120 | ||
113 | head-y := arch/sh/kernel/init_task.o | 121 | export ld-bfd BITS |
114 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | 122 | |
115 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | 123 | head-y := arch/sh/kernel/init_task.o arch/sh/kernel/head_$(BITS).o |
116 | 124 | ||
117 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ | 125 | core-y += arch/sh/kernel/ arch/sh/mm/ arch/sh/boards/ |
118 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ | 126 | core-$(CONFIG_SH_FPU_EMU) += arch/sh/math-emu/ |
@@ -193,10 +201,11 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux | |||
193 | 201 | ||
194 | compressed: zImage | 202 | compressed: zImage |
195 | 203 | ||
196 | archprepare: maketools arch/sh/lib64/syscalltab.h | 204 | archprepare: maketools |
197 | 205 | ||
198 | archclean: | 206 | archclean: |
199 | $(Q)$(MAKE) $(clean)=$(boot) | 207 | $(Q)$(MAKE) $(clean)=$(boot) |
208 | $(Q)$(MAKE) $(clean)=arch/sh/kernel/vsyscall | ||
200 | 209 | ||
201 | define archhelp | 210 | define 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' |
206 | endef | 215 | endef |
207 | 216 | ||
208 | define filechk_gen-syscalltab | 217 | 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 | ||