Makefile.in 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308
  1. # Makefile for uClibc
  2. #
  3. # Copyright (C) 2000-2008 Erik Andersen <andersen@uclibc.org>
  4. #
  5. # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  6. #
  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:
  11. #
  12. # Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
  13. #
  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.
  18. #
  19. # It has been ported to work with uClibc and generally behave
  20. # by Erik Andersen <andersen@codepoet.org>
  21. #
  22. subdirs += libm libm/$(TARGET_ARCH)
  23. CFLAGS-libm := -DNOT_IN_libc -DIS_IN_libm $(SSP_ALL_CFLAGS)
  24. libm_DIR:=$(top_srcdir)libm
  25. libm_OUT:=$(top_builddir)libm
  26. libm_ARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)
  27. libm_ARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)
  28. ifneq ($(TARGET_SUBARCH),)
  29. libm_SUBARCH_DIR:=$(libm_DIR)/$(TARGET_ARCH)/$(TARGET_SUBARCH)
  30. libm_SUBARCH_OUT:=$(libm_OUT)/$(TARGET_ARCH)/$(TARGET_SUBARCH)
  31. endif
  32. ifeq ($(UCLIBC_HAS_FPU),y)
  33. ifeq ($(DO_C99_MATH),y)
  34. -include $(libm_ARCH_DIR)/Makefile.arch
  35. -include $(libm_SUBARCH_DIR)/Makefile.arch
  36. endif
  37. endif
  38. FL_MSRC := float_wrappers.c
  39. LD_MSRC := ldouble_wrappers.c
  40. ifeq ($(DO_C99_MATH),y)
  41. libm_CSRC := \
  42. e_acos.c e_acosh.c e_asin.c e_atan2.c e_atanh.c e_cosh.c \
  43. e_exp.c e_exp10.c e_fmod.c e_hypot.c \
  44. e_lgamma_r.c e_log.c e_log2.c e_log10.c \
  45. e_pow.c e_remainder.c e_rem_pio2.c e_scalb.c e_sinh.c \
  46. e_sqrt.c k_cos.c k_rem_pio2.c k_sin.c k_tan.c \
  47. s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c s_cos.c \
  48. s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c s_frexp.c \
  49. s_ilogb.c s_ldexp.c s_lib_version.c s_lrint.c s_lround.c s_llround.c \
  50. s_log1p.c s_logb.c s_modf.c s_nextafter.c \
  51. s_nextafterf.c s_round.c \
  52. s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c s_tan.c \
  53. s_tanh.c s_trunc.c \
  54. w_cabs.c \
  55. nan.c carg.c s_llrint.c \
  56. s_fpclassify.c s_fpclassifyf.c s_signbit.c s_signbitf.c \
  57. s_isnan.c s_isnanf.c s_isinf.c s_isinff.c s_finitef.c \
  58. s_fdim.c s_fma.c s_fmax.c s_fmin.c \
  59. s_remquo.c w_exp2.c \
  60. cexp.c sincos.c
  61. FL_MOBJ := \
  62. acosf.o \
  63. acoshf.o \
  64. asinf.o \
  65. asinhf.o \
  66. atan2f.o \
  67. atanf.o \
  68. atanhf.o \
  69. cargf.o \
  70. cbrtf.o \
  71. ceilf.o \
  72. copysignf.o \
  73. cosf.o \
  74. coshf.o \
  75. erfcf.o \
  76. erff.o \
  77. exp2f.o \
  78. expf.o \
  79. expm1f.o \
  80. fabsf.o \
  81. fdimf.o \
  82. floorf.o \
  83. fmaf.o \
  84. fmaxf.o \
  85. fminf.o \
  86. fmodf.o \
  87. frexpf.o \
  88. gammaf.o \
  89. hypotf.o \
  90. ilogbf.o \
  91. ldexpf.o \
  92. lgammaf.o \
  93. llrintf.o \
  94. llroundf.o \
  95. log10f.o \
  96. log1pf.o \
  97. log2f.o \
  98. logbf.o \
  99. logf.o \
  100. lrintf.o \
  101. lroundf.o \
  102. modff.o \
  103. nearbyintf.o \
  104. nexttowardf.o \
  105. powf.o \
  106. remainderf.o \
  107. remquof.o \
  108. rintf.o \
  109. roundf.o \
  110. scalblnf.o \
  111. scalbnf.o \
  112. significandf.o \
  113. sinf.o \
  114. sinhf.o \
  115. sqrtf.o \
  116. tanf.o \
  117. tanhf.o \
  118. tgammaf.o \
  119. truncf.o \
  120. ifeq ($(UCLIBC_SUSV3_LEGACY),y)
  121. FL_MOBJ += scalbf.o
  122. endif
  123. # Do not (yet?) implement the float variants of bessel functions
  124. ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
  125. FL_MOBJ += \
  126. j0f.o \
  127. j1f.o \
  128. jnf.o \
  129. y0f.o \
  130. y1f.o \
  131. ynf.o
  132. endif
  133. LD_MOBJ := \
  134. __finitel.o \
  135. __fpclassifyl.o \
  136. __isinfl.o \
  137. __isnanl.o \
  138. __signbitl.o \
  139. acoshl.o \
  140. acosl.o \
  141. asinhl.o \
  142. asinl.o \
  143. atan2l.o \
  144. atanhl.o \
  145. atanl.o \
  146. cargl.o \
  147. cbrtl.o \
  148. ceill.o \
  149. copysignl.o \
  150. coshl.o \
  151. cosl.o \
  152. erfcl.o \
  153. erfl.o \
  154. exp2l.o \
  155. expl.o \
  156. expm1l.o \
  157. fabsl.o \
  158. fdiml.o \
  159. floorl.o \
  160. fmal.o \
  161. fmaxl.o \
  162. fminl.o \
  163. fmodl.o \
  164. frexpl.o \
  165. gammal.o \
  166. hypotl.o \
  167. ilogbl.o \
  168. ldexpl.o \
  169. lgammal.o \
  170. llrintl.o \
  171. llroundl.o \
  172. log10l.o \
  173. log1pl.o \
  174. log2l.o \
  175. logbl.o \
  176. logl.o \
  177. lrintl.o \
  178. lroundl.o \
  179. modfl.o \
  180. nearbyintl.o \
  181. nextafterl.o \
  182. nexttowardl.o \
  183. powl.o \
  184. remainderl.o \
  185. remquol.o \
  186. rintl.o \
  187. roundl.o \
  188. scalblnl.o \
  189. scalbnl.o \
  190. significandl.o \
  191. sinhl.o \
  192. sinl.o \
  193. sqrtl.o \
  194. tanhl.o \
  195. tanl.o \
  196. tgammal.o \
  197. truncl.o \
  198. # Do not (yet?) implement the long double variants of bessel functions
  199. ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
  200. LD_MOBJ += \
  201. j0l.o \
  202. j1l.o \
  203. jnl.o \
  204. y0l.o \
  205. y1l.o \
  206. ynl.o
  207. endif
  208. else
  209. # This list of math functions was taken from POSIX/IEEE 1003.1b-1993
  210. libm_CSRC := \
  211. s_atan.c s_ceil.c s_cos.c \
  212. s_fabs.c s_floor.c s_frexp.c \
  213. s_ldexp.c s_modf.c s_sin.c \
  214. s_tan.c s_tanh.c \
  215. s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \
  216. k_cos.c e_cosh.c e_exp.c e_fmod.c e_log.c e_log10.c e_pow.c \
  217. k_sin.c e_sinh.c e_sqrt.c k_tan.c e_rem_pio2.c k_rem_pio2.c \
  218. s_finite.c e_exp10.c
  219. # We'll add sqrtf to avoid problems with libstdc++
  220. FL_MOBJ := sqrtf.o
  221. endif
  222. ifeq ($(DO_XSI_MATH),y)
  223. libm_CSRC += e_j0.c e_j1.c e_jn.c
  224. endif
  225. # assume that arch specific versions are provided as single sources/objects
  226. ifeq ($(UCLIBC_HAS_FPU),y)
  227. ifeq ($(DO_C99_MATH),y)
  228. ifneq ($(strip $(libm_ARCH_OBJS)),)
  229. # remove generic sources, if arch specific version is present
  230. ifneq ($(strip $(libm_ARCH_SRC)),)
  231. libm_CSRC := $(filter-out $(notdir $(libm_ARCH_SRC)),$(libm_CSRC))
  232. endif
  233. # remove generic objects built from multi-sources, if arch specific version is present
  234. FL_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(FL_MOBJ))
  235. LD_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(LD_MOBJ))
  236. # we also try to remove % if s_% is in arch specific subdir
  237. FL_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(FL_MOBJ))
  238. LD_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(LD_MOBJ))
  239. endif
  240. endif
  241. endif
  242. libm_SRC := $(patsubst %.c,$(libm_DIR)/%.c,$(libm_CSRC))
  243. libm_OBJ := $(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
  244. ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y)
  245. libm_MSRC_LD := $(libm_DIR)/$(LD_MSRC)
  246. libm_MOBJ_LD := $(patsubst %.o,$(libm_OUT)/%.o,$(LD_MOBJ))
  247. endif
  248. libm_MSRC_FL := $(libm_DIR)/$(FL_MSRC)
  249. libm_MOBJ_FL := $(patsubst %.o,$(libm_OUT)/%.o,$(FL_MOBJ))
  250. libm_OBJS := $(libm_OBJ) $(libm_MOBJ_FL) $(libm_MOBJ_LD)
  251. ifeq ($(DOPIC),y)
  252. libm-a-y += $(libm_OBJS:.o=.os)
  253. else
  254. libm-a-y += $(libm_OBJS)
  255. endif
  256. libm-so-y += $(libm_OBJS:.o=.os)
  257. objclean-y += CLEAN_libm
  258. $(libm_OUT)/libm.oS: $(libm_SRC) $(libm_MSRC_FL) $(libm_MSRC_LD) $(libm_ARCH_SRC)
  259. $(Q)$(RM) $@
  260. $(compile-m)
  261. $(libm_MOBJ_FL): $(libm_MSRC_FL)
  262. $(compile.m)
  263. $(libm_MOBJ_LD): $(libm_MSRC_LD)
  264. $(compile.m)
  265. $(libm_MOBJ_FL:.o=.os): $(libm_MSRC_FL)
  266. $(compile.m)
  267. $(libm_MOBJ_LD:.o=.os): $(libm_MSRC_LD)
  268. $(compile.m)
  269. # spare us from adding a gazillion dummy two-liner files
  270. $(libm_MOBJ_FL:.o=.i): $(libm_MSRC_FL)
  271. $(compile.mi)
  272. $(libm_MOBJ_LD:.o=.i): $(libm_MSRC_LD)
  273. $(compile.mi)
  274. CLEAN_libm:
  275. $(do_rm) $(addprefix $(libm_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*.,$(d)$(e))))