aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/Makefile')
-rw-r--r--arch/sh/Makefile103
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#
16isa-y := any 12isa-y := any
17isa-$(CONFIG_SH_DSP) := sh 13isa-$(CONFIG_SH_DSP) := sh
@@ -21,13 +17,9 @@ isa-$(CONFIG_CPU_SH3) := sh3
21isa-$(CONFIG_CPU_SH4) := sh4 17isa-$(CONFIG_CPU_SH4) := sh4
22isa-$(CONFIG_CPU_SH4A) := sh4a 18isa-$(CONFIG_CPU_SH4A) := sh4a
23isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al 19isa-$(CONFIG_CPU_SH4AL_DSP) := sh4al
24 20isa-$(CONFIG_CPU_SH5) := shmedia
25isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp 21isa-$(CONFIG_SH_DSP) := $(isa-y)-dsp
26 22
27ifndef CONFIG_MMU
28isa-y := $(isa-y)-nommu
29endif
30
31ifndef CONFIG_SH_DSP 23ifndef CONFIG_SH_DSP
32ifndef CONFIG_SH_FPU 24ifndef CONFIG_SH_FPU
33isa-y := $(isa-y)-nofpu 25isa-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)
45cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \ 37cflags-$(CONFIG_CPU_SH4A) += $(call cc-option,-m4a,) \
46 $(call cc-option,-m4a-nofpu,) 38 $(call cc-option,-m4a-nofpu,)
39cflags-$(CONFIG_CPU_SH5) := $(call cc-option,-m5-32media-nofpu,)
47 40
48cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb 41cflags-$(CONFIG_CPU_BIG_ENDIAN) += -mb
49cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml 42cflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -ml
@@ -66,22 +59,27 @@ cflags-y += $(isaflags-y) -ffreestanding
66cflags-$(CONFIG_MORE_COMPILE_OPTIONS) += \ 59cflags-$(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
69OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -R .stab -R .stabstr -S 62OBJCOPYFLAGS := -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 66defaultimage-$(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#
76KBUILD_DEFCONFIG := r7780rp_defconfig
77 67
78KBUILD_IMAGE := arch/sh/boot/zImage 68# Set some sensible Kbuild defaults
69KBUILD_DEFCONFIG := r7780mp_defconfig
70KBUILD_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#
84LDFLAGS_vmlinux += -e _stext 76ifdef CONFIG_SUPERH32
77LDFLAGS_vmlinux += -e _stext
78else
79LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_PAGE_OFFSET) \
80 --defsym phys_stext_shmedia=phys_stext+1 \
81 -e phys_stext_shmedia
82endif
85 83
86ifdef CONFIG_CPU_LITTLE_ENDIAN 84ifdef CONFIG_CPU_LITTLE_ENDIAN
87LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' 85LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64'
@@ -94,7 +92,9 @@ endif
94KBUILD_CFLAGS += -pipe $(cflags-y) 92KBUILD_CFLAGS += -pipe $(cflags-y)
95KBUILD_AFLAGS += $(cflags-y) 93KBUILD_AFLAGS += $(cflags-y)
96 94
97head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o 95head-y := arch/sh/kernel/init_task.o
96head-$(CONFIG_SUPERH32) += arch/sh/kernel/head_32.o
97head-$(CONFIG_SUPERH64) += arch/sh/kernel/head_64.o
98 98
99LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 99LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
100 100
@@ -112,11 +112,11 @@ machdir-$(CONFIG_SH_DREAMCAST) += dreamcast
112machdir-$(CONFIG_SH_MPC1211) += mpc1211 112machdir-$(CONFIG_SH_MPC1211) += mpc1211
113machdir-$(CONFIG_SH_SH03) += sh03 113machdir-$(CONFIG_SH_SH03) += sh03
114machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear 114machdir-$(CONFIG_SH_SECUREEDGE5410) += snapgear
115machdir-$(CONFIG_SH_HS7751RVOIP) += renesas/hs7751rvoip
116machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d 115machdir-$(CONFIG_SH_RTS7751R2D) += renesas/rts7751r2d
117machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh 116machdir-$(CONFIG_SH_7751_SYSTEMH) += renesas/systemh
118machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705 117machdir-$(CONFIG_SH_EDOSK7705) += renesas/edosk7705
119machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp 118machdir-$(CONFIG_SH_HIGHLANDER) += renesas/r7780rp
119machdir-$(CONFIG_SH_SDK7780) += renesas/sdk7780
120machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw 120machdir-$(CONFIG_SH_7710VOIPGW) += renesas/sh7710voipgw
121machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto 121machdir-$(CONFIG_SH_X3PROTO) += renesas/x3proto
122machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev 122machdir-$(CONFIG_SH_SH4202_MICRODEV) += superh/microdev
@@ -127,6 +127,7 @@ machdir-$(CONFIG_SH_7206_SOLUTION_ENGINE) += se/7206
127machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619 127machdir-$(CONFIG_SH_7619_SOLUTION_ENGINE) += se/7619
128machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2 128machdir-$(CONFIG_SH_LBOX_RE2) += lboxre2
129machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2 129machdir-$(CONFIG_SH_MAGIC_PANEL_R2) += magicpanelr2
130machdir-$(CONFIG_SH_CAYMAN) += cayman
130 131
131incdir-y := $(notdir $(machdir-y)) 132incdir-y := $(notdir $(machdir-y))
132 133
@@ -137,22 +138,22 @@ endif
137 138
138# Companion chips 139# Companion chips
139core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ 140core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/
140core-$(CONFIG_MFD_SM501) += arch/sh/cchips/voyagergx/
141 141
142cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2 142cpuincdir-$(CONFIG_CPU_SH2) := cpu-sh2
143cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a 143cpuincdir-$(CONFIG_CPU_SH2A) := cpu-sh2a
144cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3 144cpuincdir-$(CONFIG_CPU_SH3) := cpu-sh3
145cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4 145cpuincdir-$(CONFIG_CPU_SH4) := cpu-sh4
146cpuincdir-$(CONFIG_CPU_SH5) := cpu-sh5
146 147
147libs-y := arch/sh/lib/ $(libs-y) $(LIBGCC) 148libs-$(CONFIG_SUPERH32) := arch/sh/lib/ $(libs-y)
149libs-$(CONFIG_SUPERH64) := arch/sh/lib64/ $(libs-y)
150libs-y += $(LIBGCC)
148 151
149drivers-y += arch/sh/drivers/ 152drivers-y += arch/sh/drivers/
150drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/ 153drivers-$(CONFIG_OPROFILE) += arch/sh/oprofile/
151 154
152boot := arch/sh/boot 155boot := arch/sh/boot
153 156
154CPPFLAGS_vmlinux.lds := -traditional
155
156incdir-prefix := $(srctree)/include/asm-sh/ 157incdir-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
199archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools
200
201PHONY += maketools FORCE 200PHONY += maketools FORCE
201
202maketools: include/linux/version.h FORCE 202maketools: 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
205all: zImage 205all: $(KBUILD_IMAGE)
206 206
207zImage uImage uImage.srec vmlinux.srec: vmlinux 207zImage uImage uImage.srec vmlinux.srec: vmlinux
208 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 208 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
209 209
210compressed: zImage 210compressed: zImage
211 211
212archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools \
213 arch/sh/lib64/syscalltab.h
214
212archclean: 215archclean:
213 $(Q)$(MAKE) $(clean)=$(boot) 216 $(Q)$(MAKE) $(clean)=$(boot)
214 217
215CLEAN_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
219define archhelp 218define 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'
224endef 223endef
224
225define 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 */" )
249endef
250
251arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S
252 $(call filechk,gen-syscalltab)
253
254CLEAN_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