diff options
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r-- | arch/sh/Makefile | 103 |
1 files changed, 68 insertions, 35 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index e189fae8b60c..17fc36186bf4 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -1,17 +1,13 @@ | |||
1 | # $Id: Makefile,v 1.35 2004/04/15 03:39:20 sugioka Exp $ | ||
2 | # | 1 | # |
3 | # This file is subject to the terms and conditions of the GNU General Public | 2 | # arch/sh/Makefile |
4 | # License. See the file "COPYING" in the main directory of this archive | ||
5 | # for more details. | ||
6 | # | 3 | # |
7 | # Copyright (C) 1999 Kaz Kojima | 4 | # Copyright (C) 1999 Kaz Kojima |
8 | # Copyright (C) 2002, 2003, 2004 Paul Mundt | 5 | # Copyright (C) 2002, 2003, 2004 Paul Mundt |
9 | # Copyright (C) 2002 M. R. Brown | 6 | # Copyright (C) 2002 M. R. Brown |
10 | # | 7 | # |
11 | # This file is included by the global makefile so that you can add your own | 8 | # This file is subject to the terms and conditions of the GNU General Public |
12 | # architecture-specific flags and dependencies. Remember to do have actions | 9 | # License. See the file "COPYING" in the main directory of this archive |
13 | # for "archclean" and "archdep" for cleaning up and making dependencies for | 10 | # for more details. |
14 | # this architecture | ||
15 | # | 11 | # |
16 | isa-y := any | 12 | isa-y := any |
17 | isa-$(CONFIG_SH_DSP) := sh | 13 | isa-$(CONFIG_SH_DSP) := sh |
@@ -21,13 +17,9 @@ isa-$(CONFIG_CPU_SH3) := sh3 | |||
21 | isa-$(CONFIG_CPU_SH4) := sh4 | 17 | isa-$(CONFIG_CPU_SH4) := sh4 |
22 | isa-$(CONFIG_CPU_SH4A) := sh4a | 18 | isa-$(CONFIG_CPU_SH4A) := sh4a |
23 | isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al | 19 | isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al |
24 | 20 | isa-$(CONFIG_CPU_SH5) := shmedia | |
25 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp | 21 | isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp |
26 | 22 | ||
27 | ifndef CONFIG_MMU | ||
28 | isa-y := $(isa-y)-nommu | ||
29 | endif | ||
30 | |||
31 | ifndef CONFIG_SH_DSP | 23 | ifndef CONFIG_SH_DSP |
32 | ifndef CONFIG_SH_FPU | 24 | ifndef CONFIG_SH_FPU |
33 | isa-y := $(isa-y)-nofpu | 25 | isa-y := $(isa-y)-nofpu |
@@ -44,6 +36,7 @@ cflags-$(CONFIG_CPU_SH4) := $(call cc-option,-m4,) \ | |||
44 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) | 36 | $(call cc-option,-mno-implicit-fp,-m4-nofpu) |
45 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ | 37 | cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ |
46 | $(call cc-option,-m4a-nofpu,) | 38 | $(call cc-option,-m4a-nofpu,) |
39 | cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,) | ||
47 | 40 | ||
48 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb | 41 | cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb |
49 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml | 42 | cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml |
@@ -66,22 +59,27 @@ cflags-y += $(isaflags-y) -ffreestanding | |||
66 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ | 59 | cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ |
67 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') | 60 | $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g') |
68 | 61 | ||
69 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -R .stab -R .stabstr -S | 62 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment \ |
63 | -R .stab -R .stabstr -S | ||
70 | 64 | ||
71 | # | 65 | # Give the various platforms the opportunity to set default image types |
72 | # arch/sh/defconfig doesn't reflect any real hardware, and as such should | 66 | defaultimage-$(CONFIG_SUPERH32) := zImage |
73 | # never be used by anyone. Use a board-specific defconfig that has a | ||
74 | # reasonable chance of being current instead. | ||
75 | # | ||
76 | KBUILD_DEFCONFIG := r7780rp_defconfig | ||
77 | 67 | ||
78 | KBUILD_IMAGE := arch/sh/boot/zImage | 68 | # Set some sensible Kbuild defaults |
69 | KBUILD_DEFCONFIG := r7780mp_defconfig | ||
70 | KBUILD_IMAGE := $(defaultimage-y) | ||
79 | 71 | ||
80 | # | 72 | # |
81 | # Choosing incompatible machines durings configuration will result in | 73 | # Choosing incompatible machines durings configuration will result in |
82 | # error messages during linking. | 74 | # error messages during linking. |
83 | # | 75 | # |
84 | LDFLAGS_vmlinux += -e _stext | 76 | ifdef CONFIG_SUPERH32 |
77 | LDFLAGS_vmlinux += -e _stext | ||
78 | else | ||
79 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \ | ||
80 | --defsym phys_stext_shmedia=phys_stext+1 \ | ||
81 | -e phys_stext_shmedia | ||
82 | endif | ||
85 | 83 | ||
86 | ifdef CONFIG_CPU_LITTLE_ENDIAN | 84 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
87 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | 85 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' |
@@ -94,7 +92,9 @@ endif | |||
94 | KBUILD_CFLAGS += -pipe $(cflags-y) | 92 | KBUILD_CFLAGS += -pipe $(cflags-y) |
95 | KBUILD_AFLAGS += $(cflags-y) | 93 | KBUILD_AFLAGS += $(cflags-y) |
96 | 94 | ||
97 | head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o | 95 | head-y := arch/sh/kernel/init_task.o |
96 | head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o | ||
97 | head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o | ||
98 | 98 | ||
99 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | 99 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) |
100 | 100 | ||
@@ -112,11 +112,11 @@ machdir-$(CONFIG_SH_DREAMCAST) += dreamcast | |||
112 | machdir-$(CONFIG_SH_MPC1211) += mpc1211 | 112 | machdir-$(CONFIG_SH_MPC1211) += mpc1211 |
113 | machdir-$(CONFIG_SH_SH03) += sh03 | 113 | machdir-$(CONFIG_SH_SH03) += sh03 |
114 | machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear | 114 | machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear |
115 | machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip | ||
116 | machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d | 115 | machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d |
117 | machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh | 116 | machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh |
118 | machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 | 117 | machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 |
119 | machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp | 118 | machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp |
119 | machdir-$(CONFIG_SH_SDK7780) += renesas/sdk7780 | ||
120 | machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw | 120 | machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw |
121 | machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto | 121 | machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto |
122 | machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev | 122 | machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev |
@@ -127,6 +127,7 @@ machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206 | |||
127 | machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 | 127 | machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 |
128 | machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 | 128 | machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 |
129 | machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2 | 129 | machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2 |
130 | machdir-$(CONFIG_SH_CAYMAN) += cayman | ||
130 | 131 | ||
131 | incdir-y := $(notdir $(machdir-y)) | 132 | incdir-y := $(notdir $(machdir-y)) |
132 | 133 | ||
@@ -137,22 +138,22 @@ endif | |||
137 | 138 | ||
138 | # Companion chips | 139 | # Companion chips |
139 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ | 140 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ |
140 | core-$(CONFIG_MFD_SM501) += arch/sh/cchips/voyagergx/ | ||
141 | 141 | ||
142 | cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2 | 142 | cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2 |
143 | cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a | 143 | cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a |
144 | cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3 | 144 | cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3 |
145 | cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4 | 145 | cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4 |
146 | cpuincdir-$(CONFIG_CPU_SH5) := cpu-sh5 | ||
146 | 147 | ||
147 | libs-y := arch/sh/lib/ $(libs-y) $(LIBGCC) | 148 | libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y) |
149 | libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y) | ||
150 | libs-y += $(LIBGCC) | ||
148 | 151 | ||
149 | drivers-y += arch/sh/drivers/ | 152 | drivers-y += arch/sh/drivers/ |
150 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ | 153 | drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ |
151 | 154 | ||
152 | boot := arch/sh/boot | 155 | boot := arch/sh/boot |
153 | 156 | ||
154 | CPPFLAGS_vmlinux.lds := -traditional | ||
155 | |||
156 | incdir-prefix := $(srctree)/include/asm-sh/ | 157 | incdir-prefix := $(srctree)/include/asm-sh/ |
157 | 158 | ||
158 | # Update machine arch and proc symlinks if something which affects | 159 | # Update machine arch and proc symlinks if something which affects |
@@ -196,29 +197,61 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ | |||
196 | done | 197 | done |
197 | @touch $@ | 198 | @touch $@ |
198 | 199 | ||
199 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools | ||
200 | |||
201 | PHONY += maketools FORCE | 200 | PHONY += maketools FORCE |
201 | |||
202 | maketools: include/linux/version.h FORCE | 202 | maketools: include/linux/version.h FORCE |
203 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h | 203 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h |
204 | 204 | ||
205 | all: zImage | 205 | all: $(KBUILD_IMAGE) |
206 | 206 | ||
207 | zImage uImage uImage.srec vmlinux.srec: vmlinux | 207 | zImage uImage uImage.srec vmlinux.srec: vmlinux |
208 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | 208 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
209 | 209 | ||
210 | compressed: zImage | 210 | compressed: zImage |
211 | 211 | ||
212 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools \ | ||
213 | arch/sh/lib64/syscalltab.h | ||
214 | |||
212 | archclean: | 215 | archclean: |
213 | $(Q)$(MAKE) $(clean)=$(boot) | 216 | $(Q)$(MAKE) $(clean)=$(boot) |
214 | 217 | ||
215 | CLEAN_FILES += include/asm-sh/machtypes.h \ | ||
216 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
217 | include/asm-sh/mach include/asm-sh/.mach | ||
218 | |||
219 | define archhelp | 218 | define archhelp |
220 | @echo '* zImage - Compressed kernel image' | 219 | @echo '* zImage - Compressed kernel image' |
221 | @echo ' vmlinux.srec - Create an ELF S-record' | 220 | @echo ' vmlinux.srec - Create an ELF S-record' |
222 | @echo ' uImage - Create a bootable image for U-Boot' | 221 | @echo ' uImage - Create a bootable image for U-Boot' |
223 | @echo ' uImage.srec - Create an S-record for U-Boot' | 222 | @echo ' uImage.srec - Create an S-record for U-Boot' |
224 | endef | 223 | endef |
224 | |||
225 | define filechk_gen-syscalltab | ||
226 | (set -e; \ | ||
227 | echo "/*"; \ | ||
228 | echo " * DO NOT MODIFY."; \ | ||
229 | echo " *"; \ | ||
230 | echo " * This file was generated by arch/sh/Makefile"; \ | ||
231 | echo " * Any changes will be reverted at build time."; \ | ||
232 | echo " */"; \ | ||
233 | echo ""; \ | ||
234 | echo "#ifndef __SYSCALLTAB_H"; \ | ||
235 | echo "#define __SYSCALLTAB_H"; \ | ||
236 | echo ""; \ | ||
237 | echo "#include <linux/kernel.h>"; \ | ||
238 | echo ""; \ | ||
239 | echo "struct syscall_info {"; \ | ||
240 | echo " const char *name;"; \ | ||
241 | echo "} syscall_info_table[] = {"; \ | ||
242 | sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ | ||
243 | s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ | ||
244 | echo "};"; \ | ||
245 | echo ""; \ | ||
246 | echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)";\ | ||
247 | echo ""; \ | ||
248 | echo "#endif /* __SYSCALLTAB_H */" ) | ||
249 | endef | ||
250 | |||
251 | arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S | ||
252 | $(call filechk,gen-syscalltab) | ||
253 | |||
254 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ | ||
255 | include/asm-sh/machtypes.h \ | ||
256 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
257 | include/asm-sh/mach include/asm-sh/.mach | ||