usr: Create objectfile for usr filesystem using .incbin
[linux-flexiantxendom0-3.2.10.git] / arch / sh / Makefile
1 # $Id: Makefile,v 1.17 2003/05/20 03:12:54 lethal 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  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 cpu-y                           := -mb
29 cpu-$(CONFIG_CPU_LITTLE_ENDIAN) := -ml
30
31 cpu-$(CONFIG_CPU_SH2)           += -m2
32 cpu-$(CONFIG_CPU_SH3)           += -m3
33 cpu-$(CONFIG_CPU_SH4)           += -m4 -mno-implicit-fp
34
35 ifdef CONFIG_SH_KGDB
36 CFLAGS :=$(CFLAGS:-fomit-frame-pointer=) -g
37 AFLAGS += -g
38 ifdef CONFIG_KGDB_MORE
39 CFLAGS += $(shell echo $(CONFIG_KGDB_OPTIONS) | sed -e 's/"//g')
40 endif
41 endif
42
43 OBJCOPYFLAGS    := -O binary -R .note -R .comment -R .stab -R .stabstr -S
44
45 #
46 # Choosing incompatible machines durings configuration will result in
47 # error messages during linking.
48 #
49 LDFLAGS_vmlinux     += -e _stext
50
51 ifdef CONFIG_CPU_LITTLE_ENDIAN
52 LDFLAGS_vmlinux     +=  --defsym 'jiffies=jiffies_64' -EL
53 else
54 LDFLAGS_vmlinux     +=  --defsym 'jiffies=jiffies_64+4' -EB
55 endif
56
57 CFLAGS          += -pipe $(cpu-y)
58 AFLAGS          += $(cpu-y)
59
60 head-y := arch/sh/kernel/head.o arch/sh/kernel/init_task.o
61
62 LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name)
63
64 core-y                          += arch/sh/kernel/ arch/sh/mm/
65
66 # Boards
67 machdir-$(CONFIG_SH_SOLUTION_ENGINE)            := se/770x
68 machdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)       := se/7751
69 machdir-$(CONFIG_SH_STB1_HARP)                  := harp
70 machdir-$(CONFIG_SH_STB1_OVERDRIVE)             := overdrive
71 machdir-$(CONFIG_SH_HP620)                      := hp6xx/hp620
72 machdir-$(CONFIG_SH_HP680)                      := hp6xx/hp680
73 machdir-$(CONFIG_SH_HP690)                      := hp6xx/hp690
74 machdir-$(CONFIG_SH_CQREEK)                     := cqreek
75 machdir-$(CONFIG_SH_DMIDA)                      := dmida
76 machdir-$(CONFIG_SH_EC3104)                     := ec3104
77 machdir-$(CONFIG_SH_SATURN)                     := saturn
78 machdir-$(CONFIG_SH_DREAMCAST)                  := dreamcast
79 machdir-$(CONFIG_SH_CAT68701)                   := cat68701
80 machdir-$(CONFIG_SH_BIGSUR)                     := bigsur
81 machdir-$(CONFIG_SH_SH2000)                     := sh2000
82 machdir-$(CONFIG_SH_ADX)                        := adx
83 machdir-$(CONFIG_SH_MPC1211)                    := mpc1211
84 machdir-$(CONFIG_SH_UNKNOWN)                    := unknown
85
86 incdir-y                        := $(machdir-y)
87
88 incdir-$(CONFIG_SH_SOLUTION_ENGINE)             := se
89 incdir-$(CONFIG_SH_7751_SOLUTION_ENGINE)        := se7751
90 incdir-$(CONFIG_SH_HP600)                       := hp6xx
91
92 core-y                          += arch/sh/boards/$(machdir-y)/
93
94 # Companion chips
95 core-$(CONFIG_HD64461)  += arch/sh/cchips/hd6446x/hd64461/
96 core-$(CONFIG_HD64465)  += arch/sh/cchips/hd6446x/hd64465/
97
98 cpuincdir-$(CONFIG_CPU_SH2)     := cpu-sh2
99 cpuincdir-$(CONFIG_CPU_SH3)     := cpu-sh3
100 cpuincdir-$(CONFIG_CPU_SH4)     := cpu-sh4
101
102 libs-y                          += arch/sh/lib/ $(LIBGCC)
103
104 boot := arch/sh/boot
105
106 AFLAGS_vmlinux.lds.o := -traditional
107
108 prepare: target_links
109
110 .PHONY: target_links FORCE
111 target_links:
112         @echo '  Making asm-sh/cpu -> asm-sh/$(cpuincdir-y) link'
113         @ln -sf $(cpuincdir-y) include/asm-sh/cpu
114
115         @echo '  Making asm-sh/mach -> asm-sh/$(incdir-y) link'
116         @ln -sf $(incdir-y) include/asm-sh/mach
117
118         $(Q)$(MAKE) $(build)=arch/sh/tools include/asm-sh/machtypes.h
119
120 BOOTIMAGE=arch/sh/boot/zImage
121 zImage: vmlinux
122         $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE)
123
124 compressed: zImage
125
126 archclean:
127         $(Q)$(MAKE) $(clean)=$(boot)