This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / arch / sh64 / Makefile
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 # Note that top level Makefile automagically builds dependencies for SUBDIRS
15 # but does not automagically clean SUBDIRS. Therefore "archclean" should clean
16 # up all, "archdep" does nothing on added SUBDIRS.
17 #
18 ifndef include_config
19 -include .config
20 endif
21
22 cpu-y                           := -mb
23 cpu-$(CONFIG_LITTLE_ENDIAN)     := -ml
24
25 cpu-$(CONFIG_CPU_SH5)           += -m5-32media-nofpu
26
27 ifdef CONFIG_LITTLE_ENDIAN
28 LDFLAGS_vmlinux         += --defsym 'jiffies=jiffies_64'
29 LDFLAGS                 += -EL  -mshlelf32_linux
30 else
31 LDFLAGS_vmlinux         += --defsym 'jiffies=jiffies_64+4'
32 LDFLAGS                 += -EB  -mshelf32_linux
33 endif
34
35 # No requirements for endianess support from AFLAGS, 'as' always run through gcc
36 AFLAGS          += -m5 -isa=sh64 -traditional
37 CFLAGS          += $(cpu-y)
38
39 LDFLAGS_vmlinux += --defsym phys_stext=_stext-$(CONFIG_CACHED_MEMORY_OFFSET) \
40                    -e phys_stext
41
42 OBJCOPYFLAGS    := -O binary -R .note -R .comment -R .stab -R .stabstr -S
43
44 ifdef LOADADDR
45 LINKFLAGS     += -Ttext $(word 1,$(LOADADDR))
46 endif
47
48 machine-$(CONFIG_SH_CAYMAN)     := cayman
49 machine-$(CONFIG_SH_SIMULATOR)  := sim
50 machine-$(CONFIG_SH_HARP)       := harp
51 machine-$(CONFIG_SH_ROMRAM)     := romram
52
53 head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
54
55 core-y += $(addprefix arch/$(ARCH)/, kernel/ mm/ mach-$(machine-y)/)
56
57 LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
58 libs-y  += arch/$(ARCH)/lib/ $(LIBGCC)
59
60 drivers-$(CONFIG_OPROFILE)      += arch/sh64/oprofile/
61
62 boot := arch/$(ARCH)/boot
63
64 zImage: vmlinux
65         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
66
67 compressed: zImage
68
69 archclean:
70         $(Q)$(MAKE) $(clean)=$(boot)
71
72 prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
73
74 include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \
75                                    include/asm include/linux/version.h
76         $(call filechk,gen-asm-offsets)
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//\t{ "/;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 += include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h
108
109 define archhelp
110         @echo '  zImage                    - Compressed kernel image (arch/sh64/boot/zImage)'
111 endef
112