diff options
author | Paul Mundt <lethal@linux-sh.org> | 2007-11-21 08:28:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-01-27 23:18:54 -0500 |
commit | d088f323574ea932a9bfc65302120e1526131887 (patch) | |
tree | be72db6c227503b37ad0f668c854cfb5e924e844 | |
parent | c2f1755becdc7c78ca07a516d358d9fa7a0a2707 (diff) |
sh: Consolidate sh/sh64 Makefiles.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r-- | arch/sh/Makefile | 50 | ||||
-rw-r--r-- | arch/sh64/Makefile | 111 |
2 files changed, 44 insertions, 117 deletions
diff --git a/arch/sh/Makefile b/arch/sh/Makefile index 3825e226dd64..afe4e6343248 100644 --- a/arch/sh/Makefile +++ b/arch/sh/Makefile | |||
@@ -139,6 +139,12 @@ core-y += $(addprefix arch/sh/boards/, \ | |||
139 | $(filter-out ., $(patsubst %,%/,$(machdir-y)))) | 139 | $(filter-out ., $(patsubst %,%/,$(machdir-y)))) |
140 | endif | 140 | endif |
141 | 141 | ||
142 | # SH-5 mach types | ||
143 | # XXX.. to be reconciled with machdir-y later. | ||
144 | core-$(CONFIG_SH_SIMULATOR) += arch/sh/mach-sim/ | ||
145 | core-$(CONFIG_SH_CAYMAN) += arch/sh/mach-cayman/ | ||
146 | core-$(CONFIG_SH_HARP) += arch/sh/mach-harp/ | ||
147 | |||
142 | # Companion chips | 148 | # Companion chips |
143 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ | 149 | core-$(CONFIG_HD6446X_SERIES) += arch/sh/cchips/hd6446x/ |
144 | core-$(CONFIG_MFD_SM501) += arch/sh/cchips/voyagergx/ | 150 | core-$(CONFIG_MFD_SM501) += arch/sh/cchips/voyagergx/ |
@@ -203,9 +209,8 @@ include/asm-sh/.mach: $(wildcard include/config/sh/*.h) \ | |||
203 | done | 209 | done |
204 | @touch $@ | 210 | @touch $@ |
205 | 211 | ||
206 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools | ||
207 | |||
208 | PHONY += maketools FORCE | 212 | PHONY += maketools FORCE |
213 | |||
209 | maketools: include/linux/version.h FORCE | 214 | maketools: include/linux/version.h FORCE |
210 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h | 215 | $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h |
211 | 216 | ||
@@ -216,16 +221,49 @@ zImage uImage uImage.srec vmlinux.srec: vmlinux | |||
216 | 221 | ||
217 | compressed: zImage | 222 | compressed: zImage |
218 | 223 | ||
224 | archprepare: include/asm-sh/.cpu include/asm-sh/.mach maketools \ | ||
225 | arch/sh/lib64/syscalltab.h | ||
226 | |||
219 | archclean: | 227 | archclean: |
220 | $(Q)$(MAKE) $(clean)=$(boot) | 228 | $(Q)$(MAKE) $(clean)=$(boot) |
221 | 229 | ||
222 | CLEAN_FILES += include/asm-sh/machtypes.h \ | ||
223 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
224 | include/asm-sh/mach include/asm-sh/.mach | ||
225 | |||
226 | define archhelp | 230 | define archhelp |
227 | @echo '* zImage - Compressed kernel image' | 231 | @echo '* zImage - Compressed kernel image' |
228 | @echo ' vmlinux.srec - Create an ELF S-record' | 232 | @echo ' vmlinux.srec - Create an ELF S-record' |
229 | @echo ' uImage - Create a bootable image for U-Boot' | 233 | @echo ' uImage - Create a bootable image for U-Boot' |
230 | @echo ' uImage.srec - Create an S-record for U-Boot' | 234 | @echo ' uImage.srec - Create an S-record for U-Boot' |
231 | endef | 235 | endef |
236 | |||
237 | define filechk_gen-syscalltab | ||
238 | (set -e; \ | ||
239 | echo "/*"; \ | ||
240 | echo " * DO NOT MODIFY."; \ | ||
241 | echo " *"; \ | ||
242 | echo " * This file was generated by arch/sh/Makefile"; \ | ||
243 | echo " * Any changes will be reverted at build time."; \ | ||
244 | echo " */"; \ | ||
245 | echo ""; \ | ||
246 | echo "#ifndef __SYSCALLTAB_H"; \ | ||
247 | echo "#define __SYSCALLTAB_H"; \ | ||
248 | echo ""; \ | ||
249 | echo "#include <linux/kernel.h>"; \ | ||
250 | echo ""; \ | ||
251 | echo "struct syscall_info {"; \ | ||
252 | echo " const char *name;"; \ | ||
253 | echo "} syscall_info_table[] = {"; \ | ||
254 | sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ | ||
255 | s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ | ||
256 | echo "};"; \ | ||
257 | echo ""; \ | ||
258 | echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)";\ | ||
259 | echo ""; \ | ||
260 | echo "#endif /* __SYSCALLTAB_H */" ) | ||
261 | endef | ||
262 | |||
263 | arch/sh/lib64/syscalltab.h: arch/sh/kernel/syscalls_64.S | ||
264 | $(call filechk,gen-syscalltab) | ||
265 | |||
266 | CLEAN_FILES += arch/sh/lib64/syscalltab.h \ | ||
267 | include/asm-sh/machtypes.h \ | ||
268 | include/asm-sh/cpu include/asm-sh/.cpu \ | ||
269 | include/asm-sh/mach include/asm-sh/.mach | ||
diff --git a/arch/sh64/Makefile b/arch/sh64/Makefile deleted file mode 100644 index 8dac7e1a2be6..000000000000 --- a/arch/sh64/Makefile +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | # | ||
2 | # This file is subject to the terms and conditions of the GNU General Public | ||
3 | # License. See the file "COPYING" in the main directory of this archive | ||
4 | # for more details. | ||
5 | # | ||
6 | # Copyright (C) 2000, 2001 Paolo Alberelli | ||
7 | # Copyright (C) 2003, 2004 Paul Mundt | ||
8 | # | ||
9 | # This file is included by the global makefile so that you can add your own | ||
10 | # architecture-specific flags and dependencies. Remember to do have actions | ||
11 | # for "archclean" and "archdep" for cleaning up and making dependencies for | ||
12 | # this architecture | ||
13 | # | ||
14 | |||
15 | cpu-y := -mb | ||
16 | cpu-$(CONFIG_LITTLE_ENDIAN) := -ml | ||
17 | |||
18 | cpu-$(CONFIG_CPU_SH5) += -m5-32media-nofpu | ||
19 | |||
20 | ifdef CONFIG_LITTLE_ENDIAN | ||
21 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64' | ||
22 | LDFLAGS += -EL -mshlelf32_linux | ||
23 | else | ||
24 | LDFLAGS_vmlinux += --defsym 'jiffies=jiffies_64+4' | ||
25 | LDFLAGS += -EB -mshelf32_linux | ||
26 | endif | ||
27 | |||
28 | # No requirements for endianess support from AFLAGS, 'as' always run through gcc | ||
29 | KBUILD_CFLAGS += $(cpu-y) | ||
30 | |||
31 | LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \ | ||
32 | --defsym phys_stext_shmedia=phys_stext+1 \ | ||
33 | -e phys_stext_shmedia | ||
34 | |||
35 | OBJCOPYFLAGS := -O binary -R .note -R .comment -R .stab -R .stabstr -S | ||
36 | |||
37 | # | ||
38 | # arch/sh64/defconfig never had any hope of being | ||
39 | # frequently updated, so use one that does | ||
40 | # | ||
41 | KBUILD_DEFCONFIG := cayman_defconfig | ||
42 | |||
43 | KBUILD_IMAGE := arch/$(ARCH)/boot/zImage | ||
44 | |||
45 | ifdef LOADADDR | ||
46 | LINKFLAGS += -Ttext $(word 1,$(LOADADDR)) | ||
47 | endif | ||
48 | |||
49 | machine-$(CONFIG_SH_CAYMAN) := cayman | ||
50 | machine-$(CONFIG_SH_SIMULATOR) := sim | ||
51 | machine-$(CONFIG_SH_HARP) := harp | ||
52 | |||
53 | head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o | ||
54 | |||
55 | core-y += arch/sh64/kernel/ arch/sh64/mm/ | ||
56 | |||
57 | ifneq ($(machine-y),) | ||
58 | core-y += arch/sh64/mach-$(machine-y)/ | ||
59 | endif | ||
60 | |||
61 | LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) | ||
62 | libs-y += arch/$(ARCH)/lib/ $(LIBGCC) | ||
63 | |||
64 | drivers-$(CONFIG_OPROFILE) += arch/sh64/oprofile/ | ||
65 | |||
66 | boot := arch/$(ARCH)/boot | ||
67 | |||
68 | zImage: vmlinux | ||
69 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ | ||
70 | |||
71 | compressed: zImage | ||
72 | |||
73 | archclean: | ||
74 | $(Q)$(MAKE) $(clean)=$(boot) | ||
75 | |||
76 | archprepare: arch/$(ARCH)/lib/syscalltab.h | ||
77 | |||
78 | define filechk_gen-syscalltab | ||
79 | (set -e; \ | ||
80 | echo "/*"; \ | ||
81 | echo " * DO NOT MODIFY."; \ | ||
82 | echo " *"; \ | ||
83 | echo " * This file was generated by arch/$(ARCH)/Makefile"; \ | ||
84 | echo " * Any changes will be reverted at build time."; \ | ||
85 | echo " */"; \ | ||
86 | echo ""; \ | ||
87 | echo "#ifndef __SYSCALLTAB_H"; \ | ||
88 | echo "#define __SYSCALLTAB_H"; \ | ||
89 | echo ""; \ | ||
90 | echo "#include <linux/kernel.h>"; \ | ||
91 | echo ""; \ | ||
92 | echo "struct syscall_info {"; \ | ||
93 | echo " const char *name;"; \ | ||
94 | echo "} syscall_info_table[] = {"; \ | ||
95 | sed -e '/^.*\.long /!d;s// { "/;s/\(\([^/]*\)\/\)\{1\}.*/\2/; \ | ||
96 | s/[ \t]*$$//g;s/$$/" },/;s/\("\)sys_/\1/g'; \ | ||
97 | echo "};"; \ | ||
98 | echo ""; \ | ||
99 | echo "#define NUM_SYSCALL_INFO_ENTRIES ARRAY_SIZE(syscall_info_table)"; \ | ||
100 | echo ""; \ | ||
101 | echo "#endif /* __SYSCALLTAB_H */" ) | ||
102 | endef | ||
103 | |||
104 | arch/$(ARCH)/lib/syscalltab.h: arch/sh64/kernel/syscalls.S | ||
105 | $(call filechk,gen-syscalltab) | ||
106 | |||
107 | CLEAN_FILES += arch/$(ARCH)/lib/syscalltab.h | ||
108 | |||
109 | define archhelp | ||
110 | @echo '* zImage - Compressed kernel image' | ||
111 | endef | ||