wordexp: Fix the usage of the internal _itoa function
[uclibc-ng.git] / libm / Makefile.in
blob4e468d4bafd4485ce83db1b9d007e78fadf66879
1 # Makefile for uClibc
3 # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
7 # The routines included in this math library are derived from the
8 # math library for Apple's MacOS X/Darwin math library, which was
9 # itself swiped from FreeBSD. The original copyright information
10 # is as follows:
12 # Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
14 # Developed at SunPro, a Sun Microsystems, Inc. business.
15 # Permission to use, copy, modify, and distribute this
16 # software is freely granted, provided that this notice
17 # is preserved.
19 # It has been ported to work with uClibc and generally behave
20 # by Erik Andersen <andersen@codepoet.org>
23 subdirs += libm libm/$(TARGET_ARCH)
25 CFLAGS-libm := -DNOT_IN_libc -DIS_IN_libm $(SSP_ALL_CFLAGS)
27 libm_DIR:=$(top_srcdir)libm
28 libm_OUT:=$(top_builddir)libm
30 libm_ARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)
31 libm_ARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)
33 ifneq ($(TARGET_SUBARCH),)
34 libm_SUBARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)/$(TARGET_SUBARCH)
35 libm_SUBARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)/$(TARGET_SUBARCH)
36 endif
38 ifeq ($(UCLIBC_HAS_FPU),y)
39 ifeq ($(DO_C99_MATH),y)
40 -include $(libm_ARCH_DIR)/Makefile.arch
41 -include $(libm_SUBARCH_DIR)/Makefile.arch
42 endif
43 endif
45 FL_MSRC := float_wrappers.c
46 LD_MSRC := ldouble_wrappers.c
48 ifeq ($(DO_C99_MATH),y)
49 libm_CSRC := \
50 e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c \
51 e_exp.c e_exp10.c e_fmod.c e_hypot.c \
52 e_lgamma_r.c e_log.c e_log2.c e_log10.c \
53 e_pow.c e_remainder.c e_rem_pio2.c e_scalb.c e_sinh.c \
54 e_sqrt.c k_cos.c k_rem_pio2.c k_sin.c k_tan.c \
55 s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c \
56 s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c s_frexp.c \
57 s_ilogb.c s_ldexp.c s_lib_version.c s_lrint.c s_lround.c s_llround.c \
58 s_log1p.c s_logb.c s_modf.c s_nextafter.c \
59 s_nextafterf.c s_round.c \
60 s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c s_tan.c \
61 s_tanh.c s_trunc.c \
62 w_cabs.c \
63 nan.c carg.c s_llrint.c \
64 s_fpclassify.c s_fpclassifyf.c s_signbit.c s_signbitf.c \
65 s_isnan.c s_isnanf.c s_isinf.c s_isinff.c s_finitef.c \
66 s_fdim.c s_fma.c s_fmax.c s_fmin.c \
67 s_remquo.c \
68 cexp.c sincos.c \
69 w_acos.c w_acosf.c w_acosl.c \
70 w_asin.c w_asinf.c w_asinl.c \
71 w_atan2.c w_atan2f.c w_atan2l.c \
72 w_hypot.c w_hypotf.c w_hypotl.c \
73 w_cosh.c w_coshf.c w_coshl.c \
74 w_exp.c w_expf.c w_expl.c \
75 w_exp2.c w_exp2f.c w_exp2l.c \
76 w_exp10.c w_exp10f.c w_exp10l.c \
77 w_lgamma_r.c w_lgammaf_r.c w_lgammal_r.c \
78 w_lgamma.c w_lgammaf.c w_lgammal.c \
79 w_tgamma.c w_tgammaf.c w_tgammal.c \
80 w_log.c w_logf.c w_logl.c \
81 w_log2.c w_log2f.c w_log2l.c \
82 w_log10.c w_log10f.c w_log10l.c \
83 w_pow.c w_powf.c w_powl.c \
84 w_sinh.c w_sinhf.c w_sinhl.c \
85 w_fmod.c w_fmodf.c w_fmodl.c \
86 w_sqrt.c w_sqrtf.c w_sqrtl.c \
87 w_remainder.c w_remainderf.c w_remainderl.c \
88 w_acosh.c w_acoshf.c w_acoshl.c \
89 w_atanh.c w_atanhf.c w_atanhl.c \
90 w_scalb.c w_scalbf.c w_scalbl.c
92 ifeq ($(UCLIBC_HAS_FENV),y)
93 libm_CSRC += k_standard.c k_standardf.c k_standardl.c
94 endif
96 FL_MOBJ := \
97 acosf.o \
98 acoshf.o \
99 asinf.o \
100 asinhf.o \
101 atan2f.o \
102 atanf.o \
103 atanhf.o \
104 cargf.o \
105 cbrtf.o \
106 ceilf.o \
107 copysignf.o \
108 cosf.o \
109 coshf.o \
110 erfcf.o \
111 erff.o \
112 exp2f.o \
113 expf.o \
114 expm1f.o \
115 fabsf.o \
116 fdimf.o \
117 floorf.o \
118 fmaf.o \
119 fmaxf.o \
120 fminf.o \
121 fmodf.o \
122 frexpf.o \
123 gammaf.o \
124 hypotf.o \
125 ilogbf.o \
126 ldexpf.o \
127 lgammaf.o \
128 llrintf.o \
129 llroundf.o \
130 log10f.o \
131 log1pf.o \
132 log2f.o \
133 logbf.o \
134 logf.o \
135 lrintf.o \
136 lroundf.o \
137 modff.o \
138 nearbyintf.o \
139 nexttowardf.o \
140 powf.o \
141 remainderf.o \
142 remquof.o \
143 rintf.o \
144 roundf.o \
145 scalblnf.o \
146 scalbnf.o \
147 significandf.o \
148 sinf.o \
149 sinhf.o \
150 sqrtf.o \
151 tanf.o \
152 tanhf.o \
153 tgammaf.o \
154 truncf.o \
156 ifeq ($(UCLIBC_SUSV3_LEGACY),y)
157 FL_MOBJ += scalbf.o
158 endif
160 # Do not (yet?) implement the float variants of bessel functions
161 ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
162 FL_MOBJ += \
163 j0f.o \
164 j1f.o \
165 jnf.o \
166 y0f.o \
167 y1f.o \
168 ynf.o
169 endif
171 LD_MOBJ := \
172 __finitel.o \
173 __fpclassifyl.o \
174 __isinfl.o \
175 __isnanl.o \
176 __signbitl.o \
177 acoshl.o \
178 acosl.o \
179 asinhl.o \
180 asinl.o \
181 atan2l.o \
182 atanhl.o \
183 atanl.o \
184 cargl.o \
185 cbrtl.o \
186 ceill.o \
187 copysignl.o \
188 coshl.o \
189 cosl.o \
190 erfcl.o \
191 erfl.o \
192 exp2l.o \
193 expl.o \
194 expm1l.o \
195 fabsl.o \
196 fdiml.o \
197 floorl.o \
198 fmal.o \
199 fmaxl.o \
200 fminl.o \
201 fmodl.o \
202 frexpl.o \
203 gammal.o \
204 hypotl.o \
205 ilogbl.o \
206 ldexpl.o \
207 lgammal.o \
208 llrintl.o \
209 llroundl.o \
210 log10l.o \
211 log1pl.o \
212 log2l.o \
213 logbl.o \
214 logl.o \
215 lrintl.o \
216 lroundl.o \
217 modfl.o \
218 nearbyintl.o \
219 nextafterl.o \
220 nexttowardl.o \
221 powl.o \
222 remainderl.o \
223 remquol.o \
224 rintl.o \
225 roundl.o \
226 scalblnl.o \
227 scalbnl.o \
228 significandl.o \
229 sinhl.o \
230 sinl.o \
231 sqrtl.o \
232 tanhl.o \
233 tanl.o \
234 tgammal.o \
235 truncl.o \
237 # Do not (yet?) implement the long double variants of bessel functions
238 ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
239 LD_MOBJ += \
240 j0l.o \
241 j1l.o \
242 jnl.o \
243 y0l.o \
244 y1l.o \
245 ynl.o
246 endif
248 else
250 # This list of math functions was taken from POSIX/IEEE 1003.1b-1993
251 libm_CSRC := \
252 s_atan.c s_ceil.c s_cos.c \
253 s_fabs.c s_floor.c s_frexp.c \
254 s_ldexp.c s_modf.c s_sin.c \
255 s_tan.c s_tanh.c \
256 s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \
257 k_cos.c e_cosh.c e_exp.c e_fmod.c e_log.c e_log10.c e_pow.c \
258 k_sin.c e_sinh.c e_sqrt.c k_tan.c e_rem_pio2.c k_rem_pio2.c \
259 s_finite.c e_exp10.c \
260 matherr_wrapers.c k_standart.c
262 # We'll add sqrtf to avoid problems with libstdc++
263 FL_MOBJ := sqrtf.o
264 endif
266 ifeq ($(DO_XSI_MATH),y)
267 libm_CSRC += \
268 e_j0.c e_j1.c e_jn.c \
269 w_j0.c w_j0f.c w_j0l.c \
270 w_j1.c w_j1f.c w_j1l.c \
271 w_jn.c w_jnf.c w_jnl.c
272 endif
274 # assume that arch specific versions are provided as single sources/objects
275 ifeq ($(UCLIBC_HAS_FPU),y)
276 ifeq ($(DO_C99_MATH),y)
277 ifneq ($(strip $(libm_ARCH_OBJS)),)
279 # remove generic sources, if arch specific version is present
280 ifneq ($(strip $(libm_ARCH_SRC)),)
281 libm_CSRC := $(filter-out $(notdir $(libm_ARCH_SRC)),$(libm_CSRC))
282 endif
284 # remove generic objects built from multi-sources, if arch specific version is present
285 FL_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(FL_MOBJ))
286 LD_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(LD_MOBJ))
288 # we also try to remove % if s_% is in arch specific subdir
289 FL_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(FL_MOBJ))
290 LD_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(LD_MOBJ))
291 endif
292 endif
293 endif
295 libm_SRC := $(patsubst %.c,$(libm_DIR)/%.c,$(libm_CSRC))
296 libm_OBJ := $(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
298 ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y)
299 libm_MSRC_LD := $(libm_DIR)/$(LD_MSRC)
300 libm_MOBJ_LD := $(patsubst %.o,$(libm_OUT)/%.o,$(LD_MOBJ))
301 endif
302 libm_MSRC_FL := $(libm_DIR)/$(FL_MSRC)
303 libm_MOBJ_FL := $(patsubst %.o,$(libm_OUT)/%.o,$(FL_MOBJ))
305 libm_OBJS := $(libm_OBJ) $(libm_MOBJ_FL) $(libm_MOBJ_LD)
307 ifeq ($(DOPIC),y)
308 libm-a-y += $(libm_OBJS:.o=.os)
309 else
310 libm-a-y += $(libm_OBJS)
311 endif
312 libm-so-y += $(libm_OBJS:.o=.os)
314 objclean-y += CLEAN_libm
316 $(libm_OUT)/libm.oS: $(libm_SRC) $(libm_MSRC_FL) $(libm_MSRC_LD) $(libm_ARCH_SRC)
317 $(Q)$(RM) $@
318 $(compile-m)
320 $(libm_MOBJ_FL): $(libm_MSRC_FL)
321 $(compile.m)
323 $(libm_MOBJ_LD): $(libm_MSRC_LD)
324 $(compile.m)
326 $(libm_MOBJ_FL:.o=.os): $(libm_MSRC_FL)
327 $(compile.m)
329 $(libm_MOBJ_LD:.o=.os): $(libm_MSRC_LD)
330 $(compile.m)
332 # spare us from adding a gazillion dummy two-liner files
333 $(libm_MOBJ_FL:.o=.i): $(libm_MSRC_FL)
334 $(compile.mi)
336 $(libm_MOBJ_LD:.o=.i): $(libm_MSRC_LD)
337 $(compile.mi)
339 CLEAN_libm:
340 $(do_rm) $(addprefix $(libm_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*.,$(d)$(e))))