OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / vendors / config / m68knommu / config.arch
1 ############################################################################
2 #
3 #  A Generic m68k 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 #  DISABLE_XIP         - set this to 1 to disable XIP code
10 #  DISABLE_SHARED_LIBS - set this to 1 to disable shared libraries
11 #  DISABLE_MOVE_RODATA - set this to 1 to disable moving rodata to text
12 #  LOPT                - library optimisation flags
13 #  UOPT                - user optimisation flags
14 #
15 #  David McCullough <davidm@snapgear.com>
16 #
17 ############################################################################
18 #
19 # Generic settings
20 #
21
22 ifndef CONSOLE_BAUD_RATE
23 CONSOLE_BAUD_RATE = 9600
24 endif
25
26 ifndef EXTRA_MODULE_DIRS
27 ifeq ($(ROOTDIR)/modules,$(wildcard $(ROOTDIR)/modules))
28 ifneq ($(filter-out linux-2.0% linux-2.2% linux-2.4%, $(LINUXDIR)),)
29 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules/
30 else
31 EXTRA_MODULE_DIRS = $(ROOTDIR)/modules
32 endif
33 endif
34 endif
35
36 ifndef VERSIONPKG
37 #define VERSIONPKG 1.0.0
38 endif
39
40 ifndef VERSIONSTR
41 VERSIONSTR = $(CONFIG_VENDOR)/$(CONFIG_PRODUCT) Version $(VERSIONPKG)
42 endif
43
44 ifndef RELFILES
45 RELFILES = boot/boot.bin,.sgb boot/boot.elf images/imagez.bin,.sgu images/image.elf
46 endif
47
48 ifndef NFIMAGE
49 NFIMAGE=imagez.bin
50 endif
51
52 ############################################################################
53 #
54 # The makefiles need to know how to do things in different contexts
55 # To save some pain we put it all here
56 #
57 # First settings we always want for all builds
58 #
59
60 # ARCH = kernel,  TARGET_ARCH = uClibc
61
62 MACHINE       = m68k
63 ifeq ($(shell egrep 'linux-2.[024]' $(ROOTDIR)/.config),)
64 ARCH          = m68k
65 else
66 ARCH          = m68knommu
67 endif
68 ENDIAN        = big
69 ifneq ($(shell which m68k-uclinux-20060615-gcc),)
70 CROSS_COMPILE = m68k-uclinux-20060615-
71 else
72 CROSS_COMPILE = m68k-uclinux-
73 endif
74 CROSS         = $(CROSS_COMPILE)
75 CONFIGURE_HOST = m68k-elf
76
77 CONFIG_UCLINUX=y
78
79 CC        = ucfront-gcc $(CROSS_COMPILE)gcc $(CPUFLAGS)
80 AS        = $(CROSS_COMPILE)as $(CPUFLAGS)
81 CXX       = ucfront-g++ $(CROSS_COMPILE)g++ $(CPUFLAGS)
82 AR        = $(CROSS_COMPILE)ar
83 LD        = ucfront-ld $(CROSS_COMPILE)ld
84 OBJCOPY   = $(CROSS_COMPILE)objcopy
85 RANLIB    = $(CROSS_COMPILE)ranlib
86 ELF2FLT   = elf2flt
87 STRIPTOOL = $(CROSS_COMPILE)strip
88 STRIP     = $(STRIPTOOL)
89
90 UCLINUX_BUILD_SET = 0                                   # have we set a special config below
91
92 ifndef DISABLE_SHARED_LIBS
93   ifeq ($(CONFIG_BINFMT_SHARED_FLAT),y)
94         BUILD_SHARED = 1
95   endif
96 endif
97
98 # These can be used by configure.
99 # Either configure $(CONFIGURE_OPTS)
100 # or     configure --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
101 #
102 TARGETARCH    := $(CROSS)linux
103 HOSTARCH      := $(shell sh $(ROOTDIR)/tools/config.guess)
104 CONFIGURE_OPTS := --host=$(TARGETARCH) --build=$(HOSTARCH) --target=$(TARGETARCH)
105
106 ############################################################################
107 #
108 # General purpose lib building rules,  uClibc.config uses these when
109 # possible
110 #
111
112 ifdef UCLINUX_BUILD_LIB
113   ifdef CONFIG_LIB_DEBUG
114         CFLAGS  :=  $(if $(LOPT),$(LOPT),-O1) -g
115   else
116         CFLAGS  :=  $(if $(LOPT),$(LOPT),-O2) -g -fomit-frame-pointer
117   endif
118         CFLAGS  += -pipe
119         CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
120         CFLAGS  += $(VENDOR_CFLAGS) -DEMBED
121
122   ifdef BUILD_SHARED
123         CFLAGS  += -mid-shared-library
124   else
125         ifndef DISABLE_XIP
126           CFLAGS  += -msep-data
127         endif
128   endif
129
130         # don't want all the CFLAGS for uClibc/Config
131         ARCH_CFLAGS := $(CPUFLAGS) $(CFLAGS)
132
133         CFLAGS  += -Dlinux -D__linux__ -Dunix
134         CFLAGS  += -D__uClinux__
135         LDFLAGS += -Wl,-elf2flt
136   ifndef DISABLE_MOVE_RODATA
137         LDFLAGS += -Wl,-move-rodata
138   endif
139
140   ifdef BUILD_SHARED
141         LDFLAGS += -mid-shared-library -mshared-library-id=0 -Wl,-shared-lib-id,0
142   else
143         ifndef DISABLE_XIP
144           LDFLAGS  += -msep-data
145         endif
146   endif
147
148         UCLINUX_BUILD_SET=1
149 endif
150
151 ############################################################################
152 #
153 # Settings for building user apps
154 #
155
156 ifdef UCLINUX_BUILD_USER
157
158   ifdef BUILD_SHARED
159         # We use a special shared libc
160         LIBC          = -Wl,-R,$(ROOTDIR)/lib/libc.gdb $(SLIBC)
161   endif
162   ifdef CONFIG_USER_DEBUG
163         CFLAGS  :=  $(if $(UOPT),$(UOPT),-O1) -g
164   else
165         CFLAGS  :=  $(if $(UOPT),$(UOPT),-Os) -g -fomit-frame-pointer
166   endif
167         CFLAGS  += -pipe
168         CFLAGS  += -fno-common -fno-builtin -Wall #-Werror
169         CFLAGS  += $(VENDOR_CFLAGS) -DEMBED
170
171   ifdef BUILD_SHARED
172         CFLAGS  += -mid-shared-library -mshared-library-id=0
173   else
174         ifndef DISABLE_XIP
175           CFLAGS  += -msep-data
176         endif
177   endif
178
179         # don't want all the CFLAGS for uClibc/Config
180         ARCH_CFLAGS := $(CFLAGS)
181
182         CFLAGS  += -Dlinux -D__linux__ -Dunix
183         CFLAGS  += -D__uClinux__
184
185         CXXFLAGS = $(CFLAGS) -nostdinc++ -fno-exceptions
186         CXXSUP := 
187
188         LDFLAGS += -Wl,-elf2flt
189   ifndef DISABLE_MOVE_RODATA
190         LDFLAGS += -Wl,-move-rodata
191   endif
192
193   ifdef BUILD_SHARED
194         LDFLAGS += -mid-shared-library -mshared-library-id=0 -Wl,-shared-lib-id,0
195   else
196         ifndef DISABLE_XIP
197           LDFLAGS  += -msep-data
198         endif
199   endif
200
201   ifndef FLTFLAGS
202         FLTFLAGS :=
203   endif
204         export FLTFLAGS
205
206         # for anyone still using it
207         CONVERT = /bin/true
208
209         UCLINUX_BUILD_SET=1
210 endif
211
212 ############################################################################
213 #
214 # fall through,  do other config options perhaps
215 #
216
217 ifeq ($(UCLINUX_BUILD_SET),1)
218         EXTRA_CFLAGS := $(CPUFLAGS)
219
220         CXXLIBS =
221          
222         LDLIBS = $(LIBBIND)
223 endif
224
225 ############################################################################