OSDN Git Service

Update cross tools prefix
[uclinux-h8/uClinux-dist.git] / vendors / config / sh / config.arch
1 ############################################################################
2 #
3 #  A Generic sh config.arch that can be included by other platforms
4 #  to reduce the number of places that need to be edited when something
5 #  common changes.  If you include this file you may provide:
6 #
7 #  CPUFLAGS            - cpu specific flags to pass to the compiler
8 #  VENDOR_CFLAGS       - vendor specific flags to pass to the compiler
9 #  LOPT                - library optimisation flags
10 #  UOPT                - user optimisation flags
11 #  GLIBC_TARGET_OPTS   - flags needed for gcc
12 #  DISABLE_SHARED_SLL  - Force openssl to not be shared.
13 #
14 #  David McCullough <davidm@snapgear.com>
15 #
16 ############################################################################
17
18 ifndef CONSOLE_BAUD_RATE
19   CONSOLE_BAUD_RATE = 57600
20 endif
21
22 ifndef EXTRA_MODULE_DIRS
23 ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules))
24 ifneq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
25 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules/
26 else
27 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules
28 endif
29 endif
30 endif
31
32 ifndef HW_PRODUCT
33   HW_PRODUCT = $(CONFIG_PRODUCT)
34 endif
35
36 ifndef HW_VENDOR
37   HW_VENDOR = $(CONFIG_VENDOR)
38 endif
39
40 ifndef VERSIONPKG
41   VERSIONPKG  := 1.0.0
42 endif
43
44 ifndef VERSIONSTR
45   VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
46 endif
47
48 ifndef RELFILES
49   RELFILES =    boot/boot.bin,.sgb boot/boot.elf                \
50                 images/image.bin,.sgu images/sh.mot images/flash.bin $(LINUXDIR)/linux \
51                 prop/config/metaconfig.conf
52 endif
53
54 ifndef NFIMAGE
55   NFIMAGE=image.bin
56 endif
57
58 ############################################################################
59 #
60 # The makefiles need to know how to do things in different contexts
61 # To save some pain we put it all here
62 #
63 # First settings we always want for all build
64
65 ENDIAN        ?= little
66 MACHINE       = sh
67 ARCH          = sh
68
69 CROSS_COMPILE = sh-unknown-uclinux-
70 ifneq ($(shell which sh-linux-gnu-gcc),)
71 CROSS_COMPILE = sh-linux-gnu-
72 endif
73 ifneq ($(shell which sh-linux-20070413-gcc),)
74 CROSS_COMPILE = sh-linux-20070413-
75 endif
76
77 KERNEL_CROSS_COMPILE = sh-unknown-uclinux-
78 ifneq ($(shell which sh-linux-gnu-gcc),)
79 KERNEL_CROSS_COMPILE = sh-linux-gnu-
80 endif
81 ifeq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
82 ifneq ($(shell which sh-linux-20021008-gcc),)
83 KERNEL_CROSS_COMPILE = sh-linux-20021008-
84 endif
85 endif
86
87 CROSS         = $(CROSS_COMPILE)
88 CONFIGURE_HOST = sh-linux
89
90 CC        = $(ucfront_cc) $(CROSS_COMPILE)gcc $(CPUFLAGS)
91 AS        = $(CROSS_COMPILE)as $(CPUFLAGS)
92 CXX       = $(ucfront_cxx) $(CROSS_COMPILE)g++ $(CPUFLAGS)
93 AR        = $(CROSS_COMPILE)ar
94 LD        = $(ucfront_ld) $(CROSS_COMPILE)ld
95 OBJCOPY   = $(CROSS_COMPILE)objcopy
96 RANLIB    = $(CROSS_COMPILE)ranlib
97 ELF2FLT   = elf2flt
98 STRIPTOOL = $(CROSS_COMPILE)strip
99 STRIP     = $(STRIPTOOL)
100
101 ############################################################################
102 #
103 # have we set a special config below
104
105 UCLINUX_BUILD_SET = 0
106
107 # These can be used by configure.
108 # Either configure $(CONFIGURE_OPTS)
109 # or     configure --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
110 #
111 TARGETARCH    := sh-linux
112 HOSTARCH      := $(shell sh $(ROOTDIR)/tools/config.guess)
113 CONFIGURE_OPTS := --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
114
115 ############################################################################
116 #
117 # General purpose lib building rules,  uClibc.config uses these when
118 # possible
119 #
120
121 ifdef UCLINUX_BUILD_LIB
122   ifdef CONFIG_LIB_DEBUG
123         CFLAGS  :=  $(if $(LOPT),$(LOPT),-O1) -g
124   else
125         CFLAGS  :=  $(if $(LOPT),$(LOPT),-O1) -g -fomit-frame-pointer
126   endif
127         CFLAGS  += -pipe
128         CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
129         CFLAGS  += $(VENDOR_CFLAGS) -DEMBED
130         LDFLAGS  += -fno-common -fno-builtin
131
132         # don't want all the CFLAGS for uClibc/Config
133         ARCH_CFLAGS := $(CFLAGS)
134
135         UCLINUX_BUILD_SET=1
136 endif
137
138 ############################################################################
139 #
140 # Settings for building user apps
141 #
142
143 ifdef UCLINUX_BUILD_USER
144   ifdef CONFIG_USER_DEBUG
145         CFLAGS  :=  $(if $(UOPT),$(UOPT),-O1) -g
146   else
147         CFLAGS  :=  $(if $(UOPT),$(UOPT),-O1) -g -fomit-frame-pointer
148   endif
149         CFLAGS  += -pipe
150         CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
151         CFLAGS  += $(VENDOR_CFLAGS) -DEMBED
152         LDFLAGS  += -fno-common -fno-builtin -Wl,-elf2flt
153
154         CXXFLAGS = $(CFLAGS) -nostdinc++
155         CXXSUP := $(shell $(CXX) -print-file-name=libsupc++.a)
156
157         FLTFLAGS :=
158         export FLTFLAGS
159
160         # for anyone still using it
161         CONVERT = /bin/true
162
163         UCLINUX_BUILD_SET=1
164 endif
165
166 ############################################################################
167 #
168 # fall through,  do other config options perhaps
169 #
170
171 ifeq ($(UCLINUX_BUILD_SET),1)
172         EXTRA_CFLAGS := $(CPUFLAGS)
173
174         CXXLIBS =
175          
176         LDLIBS = $(LIBBIND)
177         SH_LDFLAGS = $(LDFLAGS)
178         SH_LDLIBS = $(LDLIBS)
179
180         ucfront_cc  := ucfront-gcc
181         ucfront_cxx := ucfront-g++
182         ucfront_ld  := ucfront-ld
183 endif
184
185 ############################################################################