Subversion Repositories Kolibri OS

Rev

Rev 6517 | Rev 6519 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6517 Rev 6518
1
export CC = kos32-gcc
1
export CC = kos32-gcc
2
export AR = kos32-ar
2
export AR = kos32-ar
3
export LD = kos32-ld
3
export LD = kos32-ld
4
export STRIP = kos32-strip
4
export STRIP = kos32-strip
5
 
5
 
6
export SDK_DIR:= $(abspath ../../../../sdk)
6
export SDK_DIR:= $(abspath ../../../../sdk)
7
 
7
 
-
 
8
cpu_type = i386
-
 
9
enable_shared = no
8
double_type_size = 64
10
double_type_size = 64
9
long_double_type_size = 96
11
long_double_type_size = 96
10
decimal_float = yes
12
decimal_float = yes
11
enable_decimal_float = bid
13
enable_vtable_verify = no
-
 
14
enable_decimal_float = bid
12
fixed_point = no
15
fixed_point = no
13
 
16
 
14
FPBIT = true
-
 
15
 
17
 
16
DPBIT = true
-
 
17
D32PBIT = 1
-
 
18
D64PBIT = 1
-
 
19
D128PBIT = 1
-
 
20
 
-
 
21
# List of functions not to build from libgcc2.c.
-
 
22
 
-
 
-
 
18
#FPBIT = true
23
LIB2FUNCS_EXCLUDE =
19
 
24
 
20
#DPBIT = true
25
 
21
 
26
CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
22
CFLAGS_OPT+= -fomit-frame-pointer -fno-ident -mno-ms-bitfields
27
CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector
23
CFLAGS_OPT+= -fbuilding-libgcc -fno-stack-protector
28
 
24
 
29
CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS -DENABLE_DECIMAL_BID_FORMAT
25
CFLAGS = -c -O2 -DIN_GCC -DIN_LIBGCC2 -DHAVE_CC_TLS -DUSE_EMUTLS
30
CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER
26
CFLAGS+= -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -U_MSC_VER
31
CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
27
CFLAGS+= -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes
32
CFLAGS+= -Wmissing-prototypes -Wold-style-definition $(CFLAGS_OPT)
28
CFLAGS+= -Wold-style-definition $(CFLAGS_OPT)
-
 
29
 
-
 
30
DECNUMINC = -Iconfig/libbid -DENABLE_DECIMAL_BID_FORMAT
33
 
31
 
34
INCLUDES = -I. -I../gcc -I../include
32
INCLUDES = -I. -I../gcc -I../include $(DECNUMINC)
35
 
33
 
36
gcc_compile = $(CC) $(INCLUDES) $(CFLAGS)
34
gcc_compile = $(CC) $(INCLUDES) $(CFLAGS)
37
 
35
 
-
 
36
# Defined in libgcc2.c, included only in the static library.
-
 
37
LIB2FUNCS_ST = _eprintf __gcc_bcmp
-
 
38
 
-
 
39
# List of functions not to build from libgcc2.c.
-
 
40
LIB2FUNCS_EXCLUDE =
-
 
41
 
-
 
42
# These might cause a divide overflow trap and so are compiled with
-
 
43
# unwinder info.
-
 
44
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
-
 
45
 
-
 
46
 
-
 
47
 
38
objext = .o
48
objext = .o
39
 
49
 
40
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
50
FPBIT_FUNCS = _pack_sf _unpack_sf _addsub_sf _mul_sf _div_sf \
41
	_fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
51
	_fpcmp_parts_sf _compare_sf _eq_sf _ne_sf _gt_sf _ge_sf \
42
	_lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
52
	_lt_sf _le_sf _unord_sf _si_to_sf _sf_to_si _negate_sf _make_sf \
43
	_sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
53
	_sf_to_df _sf_to_tf _thenan_sf _sf_to_usi _usi_to_sf
44
 
54
 
45
DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
55
DPBIT_FUNCS = _pack_df _unpack_df _addsub_df _mul_df _div_df \
46
	_fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
56
	_fpcmp_parts_df _compare_df _eq_df _ne_df _gt_df _ge_df \
47
	_lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
57
	_lt_df _le_df _unord_df _si_to_df _df_to_si _negate_df _make_df \
48
	_df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
58
	_df_to_sf _df_to_tf _thenan_df _df_to_usi _usi_to_df
49
 
59
 
50
TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
60
TPBIT_FUNCS = _pack_tf _unpack_tf _addsub_tf _mul_tf _div_tf \
51
	_fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
61
	_fpcmp_parts_tf _compare_tf _eq_tf _ne_tf _gt_tf _ge_tf \
52
	_lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
62
	_lt_tf _le_tf _unord_tf _si_to_tf _tf_to_si _negate_tf _make_tf \
53
	_tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
63
	_tf_to_df _tf_to_sf _thenan_tf _tf_to_usi _usi_to_tf
54
 
64
 
-
 
65
# Additional sources to handle exceptions; overridden by targets as needed.
-
 
66
LIB2ADDEH = unwind-dw2.c unwind-dw2-fde.c unwind-sjlj.c unwind-c.c
-
 
67
LIB2ADDEHSTATIC = $(LIB2ADDEH)
-
 
68
 
-
 
69
#LIB2ADD = $(srcdir)/config/i386/gthr-win32.c
-
 
70
EH_MODEL = dw2
-
 
71
CUSTOM_CRTSTUFF = yes
-
 
72
 
-
 
73
 
-
 
74
crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
-
 
75
 
-
 
76
	$(crt_compile) -fno-omit-frame-pointer  -c $<
-
 
77
 
-
 
78
 
-
 
79
crtbeginS.o: $(srcdir)/config/i386/cygming-crtbegin.c
-
 
80
 
-
 
81
	$(crt_compile) -fno-omit-frame-pointer  -c $< -DCRTSTUFFS_O
-
 
82
 
-
 
83
 
-
 
84
# We intentionally use a implementation-reserved init priority of 0,
-
 
85
 
-
 
86
# so allow the warning.
-
 
87
 
-
 
88
crtend.o: $(srcdir)/config/i386/cygming-crtend.c
-
 
89
 
-
 
90
	$(crt_compile) -fno-omit-frame-pointer -Wno-error -c $<
-
 
91
 
-
 
92
# This is an endfile, Use -minline-all-stringops to ensure
-
 
93
 
-
 
94
# that __builtin_memset doesn't refer to the lib function memset().
-
 
95
 
-
 
96
crtfastmath.o: $(srcdir)/config/i386/crtfastmath.c
-
 
97
 
-
 
98
	$(gcc_compile) -mfxsr -msse -c $<
-
 
99
 
-
 
100
LIB1ASMSRC = i386/cygwin.S
-
 
101
 
-
 
102
LIB1ASMFUNCS = _chkstk _chkstk_ms 
-
 
103
 
-
 
104
DFP_ENABLE = true
-
 
105
 
-
 
106
LIB2ADD += config/i386/cpuinfo.c
-
 
107
 
-
 
108
softfp_float_modes := tf
-
 
109
softfp_int_modes := si di ti
-
 
110
 
-
 
111
softfp_extensions := sftf dftf xftf
-
 
112
 
-
 
113
softfp_truncations := tfsf tfdf tfxf
-
 
114
 
-
 
115
softfp_exclude_libgcc2 := n
-
 
116
 
-
 
117
# Omit TImode functions
-
 
118
 
-
 
119
softfp_int_modes := si di
-
 
120
 
-
 
121
 
-
 
122
# Provide fallbacks for __builtin_copysignq and __builtin_fabsq.
-
 
123
 
-
 
124
LIB2ADD += config/i386/32/tf-signs.c
-
 
125
 
-
 
126
# While emutls.c has nothing to do with EH, it is in LIB2ADDEH*
-
 
127
# instead of LIB2ADD because that's the way to be sure on some targets
-
 
128
# (e.g. *-*-darwin*) only one copy of it is linked.
-
 
129
LIB2ADDEH += emutls.c
-
 
130
LIB2ADDEHSTATIC += emutls.c
-
 
131
 
-
 
132
 
-
 
133
softfp_float_funcs = add$(m)3 div$(m)3 eq$(m)2 ge$(m)2 le$(m)2 mul$(m)3 \
-
 
134
  neg$(m)2 sub$(m)3 unord$(m)2
-
 
135
softfp_floatint_funcs = fix$(m)$(i) fixuns$(m)$(i) \
-
 
136
  float$(i)$(m) floatun$(i)$(m)
-
 
137
 
-
 
138
softfp_func_list := \
-
 
139
  $(foreach m,$(softfp_float_modes), \
-
 
140
              $(softfp_float_funcs) \
-
 
141
              $(foreach i,$(softfp_int_modes), \
-
 
142
                          $(softfp_floatint_funcs))) \
-
 
143
  $(foreach e,$(softfp_extensions),extend$(e)2) \
-
 
144
  $(foreach t,$(softfp_truncations),trunc$(t)2) \
-
 
145
  $(softfp_extras)
-
 
146
 
-
 
147
ifeq ($(softfp_exclude_libgcc2),y)
-
 
148
# This list is taken from mklibgcc.in and doesn't presently allow for
-
 
149
# 64-bit targets where si should become di and di should become ti.
-
 
150
softfp_func_list := $(filter-out floatdidf floatdisf fixunsdfsi fixunssfsi \
-
 
151
  fixunsdfdi fixdfdi fixunssfdi fixsfdi fixxfdi fixunsxfdi \
-
 
152
  floatdixf fixunsxfsi fixtfdi fixunstfdi floatditf \
-
 
153
  floatundidf floatundisf floatundixf floatunditf,$(softfp_func_list))
-
 
154
endif
-
 
155
 
-
 
156
softfp_file_list := $(addsuffix .c,$(addprefix soft-fp/,$(softfp_func_list)))
-
 
157
 
-
 
158
# Disable missing prototype and type limit warnings.  The prototypes
-
 
159
# for the functions in the soft-fp files have not been brought across
-
 
160
# from glibc.
-
 
161
 
-
 
162
soft-fp-objects-base = $(basename $(notdir $(softfp_file_list)))
-
 
163
 
-
 
164
soft-fp-objects = $(addsuffix $(objext), $(soft-fp-objects-base)) \
-
 
165
  $(addsuffix _s$(objext), $(soft-fp-objects-base))
-
 
166
 
-
 
167
$(soft-fp-objects) : INTERNAL_CFLAGS += -Wno-missing-prototypes -Wno-type-limits
-
 
168
 
-
 
169
LIB2ADD += $(softfp_file_list)
-
 
170
 
-
 
171
ifneq ($(softfp_exclude_libgcc2),y)
-
 
172
# Functions in libgcc2.c are excluded for each soft-float mode (a
-
 
173
# target may have both soft-float and hard-float modes), for the fixed
-
 
174
# list of integer modes (si and di) for which libgcc2.c defines any
-
 
175
# such functions.  Depending on the target, the si and di symbols may
-
 
176
# in fact define di and ti functions.
-
 
177
 
-
 
178
LIB2FUNCS_EXCLUDE += \
-
 
179
  $(addprefix _,$(foreach m,$(softfp_float_modes), \
-
 
180
                            $(foreach i,si di, \
-
 
181
                                        $(softfp_floatint_funcs))))
-
 
182
endif
-
 
183
 
-
 
184
iterator = empty.mk $(patsubst %,static-object.mk,$(iter-items))
-
 
185
 
55
 
186
 
56
lib2funcs =	_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2	\
187
lib2funcs =	_muldi3 _negdi2 _lshrdi3 _ashldi3 _ashrdi3 _cmpdi2 _ucmpdi2	\
57
		_clear_cache _trampoline __main _absvsi2 _absvdi2 _addvsi3	\
188
		_clear_cache _trampoline __main _absvsi2 _absvdi2 _addvsi3	\
58
		_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2	\
189
		_addvdi3 _subvsi3 _subvdi3 _mulvsi3 _mulvdi3 _negvsi2 _negvdi2	\
59
		_ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2	\
190
		_ctors _ffssi2 _ffsdi2 _clz _clzsi2 _clzdi2 _ctzsi2 _ctzdi2	\
60
		_popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2	\
191
		_popcount_tab _popcountsi2 _popcountdi2 _paritysi2 _paritydi2	\
61
		_powisf2 _powidf2 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3	\
192
		_powisf2 _powidf2 _powixf2 _powitf2 _mulsc3 _muldc3 _mulxc3	\
62
		_multc3 _divsc3 _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2	\
193
		_multc3 _divsc3 _divdc3 _divxc3 _divtc3 _bswapsi2 _bswapdi2	\
63
		_clrsbsi2 _clrsbdi2
194
		_clrsbsi2 _clrsbdi2
64
 
195
 
65
swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
196
swfloatfuncs = $(patsubst %,_fixuns%XX,sf df xf)
66
 
197
 
67
dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
198
dwfloatfuncs = $(patsubst %,_fix%XX,sf df xf tf) \
68
		$(patsubst %,_fixuns%XX,sf df xf tf) \
199
		$(patsubst %,_fixuns%XX,sf df xf tf) \
69
		$(patsubst %,_floatXX%,sf df xf tf) \
200
		$(patsubst %,_floatXX%,sf df xf tf) \
70
		$(patsubst %,_floatunXX%,sf df xf tf)
201
		$(patsubst %,_floatunXX%,sf df xf tf)
71
 
202
 
-
 
203
ifeq ($(LIB2_SIDITI_CONV_FUNCS),)
72
lib2funcs += $(subst XX,si,$(swfloatfuncs)) 
204
  lib2funcs += $(subst XX,si,$(swfloatfuncs)) 
73
lib2funcs += $(subst XX,di,$(dwfloatfuncs))
205
  lib2funcs += $(subst XX,di,$(dwfloatfuncs))
-
 
206
endif
-
 
207
 
-
 
208
# These might cause a divide overflow trap and so are compiled with
-
 
209
# unwinder info.
-
 
210
LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
-
 
211
 
-
 
212
# Remove any objects from lib2funcs and LIB2_DIVMOD_FUNCS that are
-
 
213
# defined as optimized assembly code in LIB1ASMFUNCS or as C code
-
 
214
# in LIB2FUNCS_EXCLUDE.
-
 
215
lib2funcs := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS),$(lib2funcs))
-
 
216
LIB2_DIVMOD_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE) $(LIB1ASMFUNCS), \
-
 
217
		       $(LIB2_DIVMOD_FUNCS))
74
 
-
 
-
 
218
 
-
 
219
 
75
lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
220
# Build lib2funcs.  For the static library also include LIB2FUNCS_ST.
76
 
221
lib2funcs-o = $(patsubst %,%$(objext),$(lib2funcs) $(LIB2FUNCS_ST))
-
 
222
$(lib2funcs-o): %$(objext): libgcc2.c
-
 
223
	$(gcc_compile) -DL$* -c $< -o $@
-
 
224
libgcc-objects += $(lib2funcs-o)
-
 
225
 
-
 
226
ifneq ($(LIB2_SIDITI_CONV_FUNCS),)
-
 
227
# Build libgcc2.c for each conversion function, with a specific
-
 
228
# L definition and LIBGCC2_UNITS_PER_WORD setting.  The DImode
-
 
229
# functions are built with a wordsize of 4; the TImode functions are
-
 
230
# built with the same labels, but a wordsize of 8.
-
 
231
 
-
 
232
sifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,si,$(swfloatfuncs)))
-
 
233
difuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,di,$(dwfloatfuncs)))
-
 
234
tifuncs := $(filter-out $(LIB2FUNCS_EXCLUDE),$(subst XX,ti,$(dwfloatfuncs)))
-
 
235
 
-
 
236
iter-items := $(sifuncs) $(difuncs) $(tifuncs)
-
 
237
iter-labels := $(sifuncs) $(difuncs) $(difuncs)
-
 
238
iter-sizes := $(patsubst %,4,$(sifuncs) $(difuncs)) $(patsubst %,8,$(tifuncs))
-
 
239
 
-
 
240
include empty.mk $(patsubst %,siditi-object.mk,$(iter-items))
-
 
241
 
-
 
242
libgcc-objects += $(patsubst %,%$(objext),$(sifuncs) $(difuncs) $(tifuncs))
-
 
243
endif
-
 
244
 
-
 
245
ifeq ($(LIB2_DIVMOD_EXCEPTION_FLAGS),)
-
 
246
# Provide default flags for compiling divmod functions, if they haven't been
-
 
247
# set already by a target-specific Makefile fragment.
-
 
248
LIB2_DIVMOD_EXCEPTION_FLAGS := -fexceptions -fnon-call-exceptions
-
 
249
endif
-
 
250
 
-
 
251
# Build LIB2_DIVMOD_FUNCS.
77
$(lib2funcs-o): %$(objext): libgcc2.c
252
lib2-divmod-o = $(patsubst %,%$(objext),$(LIB2_DIVMOD_FUNCS))
78
	$(gcc_compile) -DL$* -c $< -o $@
253
$(lib2-divmod-o): %$(objext): libgcc2.c
79
 
254
	$(gcc_compile) -DL$* -c $< $(LIB2_DIVMOD_EXCEPTION_FLAGS) -o $@
80
libgcc-objects =
255
libgcc-objects += $(lib2-divmod-o)
81
 
256
 
82
ifeq ($(TPBIT),)
257
ifeq ($(TPBIT),)
83
# _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
258
# _sf_to_tf and _df_to_tf require tp-bit.c being compiled in.
84
FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
259
FPBIT_FUNCS := $(filter-out _sf_to_tf,$(FPBIT_FUNCS))
85
DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
260
DPBIT_FUNCS := $(filter-out _df_to_tf,$(DPBIT_FUNCS))
86
endif
261
endif
87
 
262
 
88
FPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(FPBIT_FUNCS))
263
FPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(FPBIT_FUNCS))
89
DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS))
264
DPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(DPBIT_FUNCS))
90
TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS))
265
TPBIT_FUNCS := $(filter-out $(LIB2FUNCS_EXCLUDE),$(TPBIT_FUNCS))
91
 
266
 
92
fpbit-src := fp-bit.c
267
fpbit-src := fp-bit.c
93
 
268
 
94
# Build FPBIT.
269
# Build FPBIT.
95
ifneq ($(FPBIT),)
270
ifneq ($(FPBIT),)
96
fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
271
fpbit-o = $(patsubst %,%$(objext),$(FPBIT_FUNCS))
97
$(fpbit-o): %$(objext): $(fpbit-src)
272
$(fpbit-o): %$(objext): $(fpbit-src)
98
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< -o $@
273
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DFLOAT $(FPBIT_CFLAGS) -c $< -o $@
99
libgcc-objects += $(fpbit-o)
274
libgcc-objects += $(fpbit-o)
100
endif
275
endif
101
 
276
 
102
# Build DPBIT.
277
# Build DPBIT.
103
ifneq ($(DPBIT),)
278
ifneq ($(DPBIT),)
104
dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
279
dpbit-o = $(patsubst %,%$(objext),$(DPBIT_FUNCS))
105
$(dpbit-o): %$(objext): $(fpbit-src)
280
$(dpbit-o): %$(objext): $(fpbit-src)
106
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< -o $@
281
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* $(DPBIT_CFLAGS) -c $< -o $@
107
libgcc-objects += $(dpbit-o)
282
libgcc-objects += $(dpbit-o)
108
endif
283
endif
109
 
284
 
110
# Build TPBIT.
285
# Build TPBIT.
111
ifneq ($(TPBIT),)
286
ifneq ($(TPBIT),)
112
tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
287
tpbit-o = $(patsubst %,%$(objext),$(TPBIT_FUNCS))
113
$(tpbit-o): %$(objext): $(fpbit-src)
288
$(tpbit-o): %$(objext): $(fpbit-src)
114
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< -o $@
289
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DTFLOAT $(TPBIT_CFLAGS) -c $< -o $@
115
libgcc-objects += $(tpbit-o)
290
libgcc-objects += $(tpbit-o)
116
endif
291
endif
117
 
292
 
-
 
293
# Build decimal floating point support.
-
 
294
ifeq ($(decimal_float),yes)
-
 
295
 
-
 
296
# If $DFP_ENABLE is set, then we want all data type sizes.
-
 
297
ifneq ($(DFP_ENABLE),)
-
 
298
D32PBIT = 1
-
 
299
D64PBIT = 1
-
 
300
D128PBIT = 1
-
 
301
endif
-
 
302
 
-
 
303
dfp-filenames =
-
 
304
ifneq ($(D32PBIT)$(D64PBIT)$(D128PBIT),)
-
 
305
ifeq ($(enable_decimal_float),bid)
-
 
306
dfp-filenames += bid_decimal_globals bid_decimal_data \
-
 
307
		 bid_binarydecimal bid_convert_data \
-
 
308
		 _isinfd32 _isinfd64 _isinfd128 bid64_noncomp \
-
 
309
		 bid128_noncomp bid128_fma bid_round bid_from_int \
-
 
310
		 bid64_add bid128_add bid64_div bid128_div \
-
 
311
		 bid64_mul bid128_mul bid64_compare bid128_compare \
-
 
312
		 bid128 bid32_to_bid64 bid32_to_bid128 bid64_to_bid128 \
-
 
313
		 bid64_to_int32 bid64_to_int64 \
-
 
314
		 bid64_to_uint32 bid64_to_uint64 \
-
 
315
		 bid128_to_int32 bid128_to_int64 \
-
 
316
		 bid128_to_uint32 bid128_to_uint64
-
 
317
else
-
 
318
dfp-filenames += decContext decNumber decExcept decRound decLibrary decDouble decPacked decQuad decSingle
-
 
319
endif
-
 
320
endif
-
 
321
 
-
 
322
 
-
 
323
dfp-objects = $(patsubst %,%$(objext),$(dfp-filenames))
-
 
324
ifeq ($(enable_decimal_float),bid)
-
 
325
$(dfp-objects): %$(objext): config/libbid/%.c
-
 
326
else
-
 
327
$(dfp-objects): %$(objext): ../libdecnumber/%.c
-
 
328
endif
-
 
329
	$(gcc_compile) -c $<
-
 
330
libgcc-objects += $(dfp-objects)
-
 
331
 
-
 
332
decbits-filenames =
-
 
333
ifneq ($(enable_decimal_float),bid)
-
 
334
ifneq ($(D32PBIT),)
-
 
335
decbits-filenames += decimal32
-
 
336
endif
-
 
337
 
-
 
338
ifneq ($(D64PBIT),)
-
 
339
decbits-filenames += decimal64
-
 
340
endif
-
 
341
 
-
 
342
ifneq ($(D128PBIT),)
-
 
343
decbits-filenames += decimal128
-
 
344
endif
-
 
345
endif
-
 
346
 
-
 
347
decbits-objects = $(patsubst %,%$(objext),$(decbits-filenames))
-
 
348
ifeq ($(enable_decimal_float),bid)
-
 
349
$(decbits-objects): %$(objext): config/libbid/%.c
-
 
350
else
-
 
351
$(decbits-objects): %$(objext): ../libdecnumber/$(enable_decimal_float)/%.c
-
 
352
endif
-
 
353
	$(gcc_compile) -c $<
-
 
354
libgcc-objects += $(decbits-objects)
-
 
355
 
-
 
356
 
-
 
357
 
118
# Next build individual support functions.
358
# Next build individual support functions.
119
D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
359
D32PBIT_FUNCS = _addsub_sd _div_sd _mul_sd _plus_sd _minus_sd \
120
	_eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
360
	_eq_sd _ne_sd _lt_sd _gt_sd _le_sd _ge_sd \
121
	_sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
361
	_sd_to_si _sd_to_di _sd_to_usi _sd_to_udi \
122
	_si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
362
	_si_to_sd _di_to_sd _usi_to_sd _udi_to_sd \
123
	_sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
363
	_sd_to_sf _sd_to_df _sd_to_xf _sd_to_tf \
124
	_sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
364
	_sf_to_sd _df_to_sd _xf_to_sd _tf_to_sd \
125
	_sd_to_dd _sd_to_td _unord_sd _conv_sd
365
	_sd_to_dd _sd_to_td _unord_sd _conv_sd
126
 
366
 
127
D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
367
D64PBIT_FUNCS = _addsub_dd _div_dd _mul_dd _plus_dd _minus_dd \
128
	_eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
368
	_eq_dd _ne_dd _lt_dd _gt_dd _le_dd _ge_dd \
129
	_dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
369
	_dd_to_si _dd_to_di _dd_to_usi _dd_to_udi \
130
	_si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
370
	_si_to_dd _di_to_dd _usi_to_dd _udi_to_dd \
131
	_dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
371
	_dd_to_sf _dd_to_df _dd_to_xf _dd_to_tf \
132
	_sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
372
	_sf_to_dd _df_to_dd _xf_to_dd _tf_to_dd \
133
	_dd_to_sd _dd_to_td _unord_dd _conv_dd
373
	_dd_to_sd _dd_to_td _unord_dd _conv_dd
134
 
374
 
135
D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
375
D128PBIT_FUNCS = _addsub_td _div_td _mul_td _plus_td _minus_td \
136
	_eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
376
	_eq_td _ne_td _lt_td _gt_td _le_td _ge_td \
137
	_td_to_si _td_to_di _td_to_usi _td_to_udi \
377
	_td_to_si _td_to_di _td_to_usi _td_to_udi \
138
	_si_to_td _di_to_td _usi_to_td _udi_to_td \
378
	_si_to_td _di_to_td _usi_to_td _udi_to_td \
139
	_td_to_sf _td_to_df _td_to_xf _td_to_tf \
379
	_td_to_sf _td_to_df _td_to_xf _td_to_tf \
140
	_sf_to_td _df_to_td _xf_to_td _tf_to_td \
380
	_sf_to_td _df_to_td _xf_to_td _tf_to_td \
141
	_td_to_sd _td_to_dd _unord_td _conv_td
381
	_td_to_sd _td_to_dd _unord_td _conv_td
142
 
382
 
143
ifeq ($(enable_decimal_float),bid)
383
ifeq ($(enable_decimal_float),bid)
144
ifneq ($(D32PBIT),)
384
ifneq ($(D32PBIT),)
145
D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
385
D32PBIT_FUNCS:=$(filter-out _plus_sd _minus_sd _conv_sd, $(D32PBIT_FUNCS))
146
endif
386
endif
147
 
387
 
148
ifneq ($(D64PBIT),)
388
ifneq ($(D64PBIT),)
149
D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
389
D64PBIT_FUNCS:=$(filter-out _plus_dd _minus_dd _conv_dd, $(D64PBIT_FUNCS))
150
endif
390
endif
151
 
391
 
152
ifneq ($(D128PBIT),)
392
ifneq ($(D128PBIT),)
153
D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
393
D128PBIT_FUNCS:=$(filter-out _plus_td _minus_td _conv_td, $(D128PBIT_FUNCS))
154
endif
394
endif
155
endif
395
endif
156
 
396
 
157
ifneq ($(D32PBIT),)
397
ifneq ($(D32PBIT),)
158
d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
398
d32pbit-o = $(patsubst %,%$(objext),$(D32PBIT_FUNCS))
159
ifeq ($(enable_decimal_float),bid)
399
ifeq ($(enable_decimal_float),bid)
160
$(d32pbit-o): %$(objext): config/libbid/%.c
400
$(d32pbit-o): %$(objext): config/libbid/%.c
161
else
401
else
162
$(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
402
$(d32pbit-o): %$(objext): $(srcdir)/dfp-bit.c
163
endif
403
endif
164
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $< -o $@
404
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=32 -c $< -o $@
165
libgcc-objects += $(d32pbit-o)
405
libgcc-objects += $(d32pbit-o)
166
endif
406
endif
167
 
407
 
168
ifneq ($(D64PBIT),)
408
ifneq ($(D64PBIT),)
169
d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
409
d64pbit-o = $(patsubst %,%$(objext),$(D64PBIT_FUNCS))
170
ifeq ($(enable_decimal_float),bid)
410
ifeq ($(enable_decimal_float),bid)
171
$(d64pbit-o): %$(objext): config/libbid/%.c
411
$(d64pbit-o): %$(objext): config/libbid/%.c
172
else
412
else
173
$(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
413
$(d64pbit-o): %$(objext): $(srcdir)/dfp-bit.c
174
endif
414
endif
175
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
415
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=64 -c $<
176
libgcc-objects += $(d64pbit-o)
416
libgcc-objects += $(d64pbit-o)
177
endif
417
endif
178
 
418
 
179
ifneq ($(D128PBIT),)
419
ifneq ($(D128PBIT),)
180
d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
420
d128pbit-o = $(patsubst %,%$(objext),$(D128PBIT_FUNCS))
181
ifeq ($(enable_decimal_float),bid)
421
ifeq ($(enable_decimal_float),bid)
182
$(d128pbit-o): %$(objext): config/libbid/%.c
422
$(d128pbit-o): %$(objext): config/libbid/%.c
183
else
423
else
184
$(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
424
$(d128pbit-o): %$(objext): $(srcdir)/dfp-bit.c
185
endif
425
endif
186
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
426
	$(gcc_compile) -DFINE_GRAINED_LIBRARIES -DL$* -DWIDTH=128 -c $<
187
libgcc-objects += $(d128pbit-o)
427
libgcc-objects += $(d128pbit-o)
188
endif
428
endif
189
 
429
 
-
 
430
endif
-
 
431
 
-
 
432
# Build LIB2ADD and LIB2ADD_ST.
-
 
433
ifneq ($(filter-out %.c %.S %.asm,$(LIB2ADD) $(LIB2ADD_ST)),)
-
 
434
$(error Unsupported files in LIB2ADD or LIB2ADD_ST.)
-
 
435
endif
-
 
436
 
-
 
437
libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD))))
-
 
438
#libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADD_ST))))
-
 
439
 
-
 
440
c_flags :=
-
 
441
iter-items := $(LIB2ADD) $(LIB2ADD_ST)
-
 
442
include $(iterator)
-
 
443
 
-
 
444
c_flags := -fexceptions
-
 
445
 
-
 
446
#libgcc-objects += $(addsuffix $(objext),$(basename $(notdir $(LIB2ADDEH))))
-
 
447
 
-
 
448
iter-items := $(LIB2ADDEH)
-
 
449
include $(iterator)
-
 
450
 
-
 
451
 
190
# targets 
452
# targets 
191
 
453
 
192
all: libgcc.a
454
all: libgcc.a
193
 
455
 
194
libgcc.a : $(lib2funcs-o) $(libgcc-objects) Makefile
456
libgcc.a : $(libgcc-objects) Makefile
195
	$(AR) crs libgcc.a $(lib2funcs-o) $(libgcc-objects)
457
	$(AR) crs libgcc.a $(libgcc-objects)
196
#	mv -f libbfd.a $(SDK_DIR)/lib
458
#	mv -f libbfd.a $(SDK_DIR)/lib
197
libgcc-objects>
459
libgcc-objects>
198
libgcc-objects>
460
libgcc-objects>
-
 
461
libgcc-objects>
-
 
462
libgcc-objects>
-
 
463
 
-
 
464
LIB1ASMSRC>
-
 
465
 
-
 
466
#>
-
 
467
 
-
 
468
 
-
 
469
crtbeginS.o:>