VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / arch / sh / Makefile
1 # $Id: Makefile,v 1.35 2004/04/15 03:39:20 sugioka Exp $
2 #
3 # This file is subject to the terms and conditions of the GNU General Public
4 # License.  See the file "COPYING" in the main directory of this archive
5 # for more details.
6 #
7 # Copyright (C) 1999  Kaz Kojima
8 # Copyright (C) 2002, 2003, 2004  Paul Mundt
9 # Copyright (C) 2002  M. R. Brown
10 #
11 # This file is included by the global makefile so that you can add your own
12 # architecture-specific flags and dependencies. Remember to do have actions
13 # for "archclean" and "archdep" for cleaning up and making dependencies for
14 # this architecture
15 #
16
17 #
18 # We don't necessarily agree with the top-level Makefile with regards to what
19 # does and does not qualify as a noconfig_targets rule. In this case, we're
20 # still dependant on .config settings in order for core-y (machdir-y in
21 # particular) to resolve the proper directory. So we just manually include it
22 # if it hasn't been already..
23
24 ifndef include_config
25 -include .config
26 endif
27
28 cflags-y                                := -mb
29 cflags-$(CONFIG_CPU_LITTLE_ENDIAN)      := -ml
30
31 cflags-$(CONFIG_CPU_SH2)                += -m2
32 cflags-$(CONFIG_CPU_SH3)                += -m3
33 cflags-$(CONFIG_CPU_SH4)                += -m4 \
34         $(call check_gcc,-mno-implicit-fp,-m4-nofpu)
35
36 cflags-$(CONFIG_SH_DSP)                 += -Wa,-dsp
37 cflags-$(CONFIG_SH_KGDB)                += -g
38
39 cflags-$(CONFIG_MORE_COMPILE_OPTIONS)   += \
40         $(shell echo $(CONFIG_COMPILE_OPTIONS) | sed -e 's/"//g')
41
42 OBJCOPYFLAGS    := -O binary -R .note -R .comment -R .stab -R .stabstr -S
43
44 #
45 # Choosing incompatible machines durings configuration will result in
46 # error messages during linking.
47 #
48 LDFLAGS_vmlinux     += -e _stext
49
50 ifdef CONFIG_CPU_LITTLE_ENDIAN
51 LDFLAGS_vmlinux         += --defsym 'jiffies=jiffies_64'
52 LDFLAGS                 += -EL
53 else
54 LDFLAGS_vmlinux         += --defsym 'jiffies=jiffies_64+4'
55 LDFLAGS                 += -EB
56 endif
57
58 CFLAGS          += -pipe $(cflags-y)
59 AFLAGS          += $(cflags-y)
60
61 head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
62
63 LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
64
65 core-y                          += arch/sh/kernel/ arch/sh/mm/
66
67 #
68 # ramdisk/initrd support
69 # You need a compressed ramdisk image, named
70 # CONFIG_EMBEDDED_RAMDISK_IMAGE. Relative pathnames
71 # are relative to arch/sh/ramdisk/.
72 #
73 core-$(CONFIG_EMBEDDED_RAMDISK) += arch/sh/ramdisk/
74
75 # Boards
76 machdir-$(CONFIG_SH_SOLUTION_ENGINE)            := se/770x
77 machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)       := se/7751
78 machdir-$(CONFIG_SH_7300_SOLUTION_ENGINE)       := se/7300
79 machdir-$(CONFIG_SH_STB1_HARP)                  := harp
80 machdir-$(CONFIG_SH_STB1_OVERDRIVE)             := overdrive
81 machdir-$(CONFIG_SH_HP620)                      := hp6xx/hp620
82 machdir-$(CONFIG_SH_HP680)                      := hp6xx/hp680
83 machdir-$(CONFIG_SH_HP690)                      := hp6xx/hp690
84 machdir-$(CONFIG_SH_CQREEK)                     := cqreek
85 machdir-$(CONFIG_SH_DMIDA)                      := dmida
86 machdir-$(CONFIG_SH_EC3104)                     := ec3104
87 machdir-$(CONFIG_SH_SATURN)                     := saturn
88 machdir-$(CONFIG_SH_DREAMCAST)                  := dreamcast
89 machdir-$(CONFIG_SH_CAT68701)                   := cat68701
90 machdir-$(CONFIG_SH_BIGSUR)                     := bigsur
91 machdir-$(CONFIG_SH_SH2000)                     := sh2000
92 machdir-$(CONFIG_SH_ADX)                        := adx
93 machdir-$(CONFIG_SH_MPC1211)                    := mpc1211
94 machdir-$(CONFIG_SH_SECUREEDGE5410)             := snapgear
95 machdir-$(CONFIG_SH_HS7751RVOIP)                := renesas/hs7751rvoip
96 machdir-$(CONFIG_SH_RTS7751R2D)                 := renesas/rts7751r2d
97 machdir-$(CONFIG_SH_7751_SYSTEMH)               := renesas/systemh
98 machdir-$(CONFIG_SH_UNKNOWN)                    := unknown
99
100 incdir-y                        := $(notdir $(machdir-y))
101
102 incdir-$(CONFIG_SH_SOLUTION_ENGINE)             := se
103 incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)        := se7751
104 incdir-$(CONFIG_SH_7300_SOLUTION_ENGINE)        := se7300
105 incdir-$(CONFIG_SH_HP600)                       := hp6xx
106
107 core-y                          += arch/sh/boards/$(machdir-y)/
108
109 # Companion chips
110 core-$(CONFIG_HD64461)          += arch/sh/cchips/hd6446x/hd64461/
111 core-$(CONFIG_HD64465)          += arch/sh/cchips/hd6446x/hd64465/
112 core-$(CONFIG_VOYAGERGX)        += arch/sh/cchips/voyagergx/
113
114 cpuincdir-$(CONFIG_CPU_SH2)     := cpu-sh2
115 cpuincdir-$(CONFIG_CPU_SH3)     := cpu-sh3
116 cpuincdir-$(CONFIG_CPU_SH4)     := cpu-sh4
117
118 libs-y                          := arch/sh/lib/ $(libs-y) $(LIBGCC)
119
120 drivers-y                       += arch/sh/drivers/
121 drivers-$(CONFIG_OPROFILE)      += arch/sh/oprofile/
122
123 boot := arch/sh/boot
124
125 AFLAGS_vmlinux.lds.o := -traditional
126
127 prepare: target_links
128
129 .PHONY: target_links FORCE
130
131 all: zImage
132
133 target_links:
134         @echo '  Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link'
135         @rm -f include/asm-sh/cpu
136         @ln -sf $(cpuincdir-y) include/asm-sh/cpu
137
138         @echo '  Making asm-sh/mach -> asm-sh/$(incdir-y) link'
139         @rm -f include/asm-sh/mach
140         @ln -sf $(incdir-y) include/asm-sh/mach
141
142         $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
143
144 zImage: vmlinux
145         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
146
147 compressed: zImage
148
149 archclean:
150         $(Q)$(MAKE) $(clean)=$(boot)
151
152 define archhelp
153         @echo '  zImage                    - Compressed kernel image (arch/sh/boot/zImage)'
154 endef
155