Makefile.in 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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 \
  60. cexp.c sincos.c \
  61. w_acos.c w_acosf.c w_acosl.c \
  62. w_asin.c w_asinf.c w_asinl.c \
  63. w_atan2.c w_atan2f.c w_atan2l.c \
  64. w_hypot.c w_hypotf.c w_hypotl.c \
  65. w_cosh.c w_coshf.c w_coshl.c \
  66. w_exp.c w_expf.c w_expl.c \
  67. w_exp2.c w_exp2f.c w_exp2l.c \
  68. w_exp10.c w_exp10f.c w_exp10l.c \
  69. w_j0.c w_j0f.c w_j0l.c \
  70. w_j1.c w_j1f.c w_j1l.c \
  71. w_jn.c w_jnf.c w_jnl.c \
  72. w_lgamma_r.c w_lgammaf_r.c w_lgammal_r.c \
  73. w_lgamma.c w_lgammaf.c w_lgammal.c \
  74. w_tgamma.c w_tgammaf.c w_tgammal.c \
  75. w_log.c w_logf.c w_logl.c \
  76. w_log2.c w_log2f.c w_log2l.c \
  77. w_log10.c w_log10f.c w_log10l.c \
  78. w_pow.c w_powf.c w_powl.c \
  79. w_sinh.c w_sinhf.c w_sinhl.c \
  80. w_fmod.c w_fmodf.c w_fmodl.c \
  81. w_sqrt.c w_sqrtf.c w_sqrtl.c \
  82. w_remainder.c w_remainderf.c w_remainderl.c \
  83. w_acosh.c w_acoshf.c w_acoshl.c \
  84. w_atanh.c w_atanhf.c w_atanhl.c \
  85. w_scalb.c w_scalbf.c w_scalbl.c
  86. ifeq ($(UCLIBC_HAS_FENV),y)
  87. libm_CSRC += k_standard.c k_standardf.c k_standardl.c
  88. endif
  89. FL_MOBJ := \
  90. acosf.o \
  91. acoshf.o \
  92. asinf.o \
  93. asinhf.o \
  94. atan2f.o \
  95. atanf.o \
  96. atanhf.o \
  97. cargf.o \
  98. cbrtf.o \
  99. ceilf.o \
  100. copysignf.o \
  101. cosf.o \
  102. coshf.o \
  103. erfcf.o \
  104. erff.o \
  105. exp2f.o \
  106. expf.o \
  107. expm1f.o \
  108. fabsf.o \
  109. fdimf.o \
  110. floorf.o \
  111. fmaf.o \
  112. fmaxf.o \
  113. fminf.o \
  114. fmodf.o \
  115. frexpf.o \
  116. gammaf.o \
  117. hypotf.o \
  118. ilogbf.o \
  119. ldexpf.o \
  120. lgammaf.o \
  121. llrintf.o \
  122. llroundf.o \
  123. log10f.o \
  124. log1pf.o \
  125. log2f.o \
  126. logbf.o \
  127. logf.o \
  128. lrintf.o \
  129. lroundf.o \
  130. modff.o \
  131. nearbyintf.o \
  132. nexttowardf.o \
  133. powf.o \
  134. remainderf.o \
  135. remquof.o \
  136. rintf.o \
  137. roundf.o \
  138. scalblnf.o \
  139. scalbnf.o \
  140. significandf.o \
  141. sinf.o \
  142. sinhf.o \
  143. sqrtf.o \
  144. tanf.o \
  145. tanhf.o \
  146. tgammaf.o \
  147. truncf.o \
  148. ifeq ($(UCLIBC_SUSV3_LEGACY),y)
  149. FL_MOBJ += scalbf.o
  150. endif
  151. # Do not (yet?) implement the float variants of bessel functions
  152. ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
  153. FL_MOBJ += \
  154. j0f.o \
  155. j1f.o \
  156. jnf.o \
  157. y0f.o \
  158. y1f.o \
  159. ynf.o
  160. endif
  161. LD_MOBJ := \
  162. __finitel.o \
  163. __fpclassifyl.o \
  164. __isinfl.o \
  165. __isnanl.o \
  166. __signbitl.o \
  167. acoshl.o \
  168. acosl.o \
  169. asinhl.o \
  170. asinl.o \
  171. atan2l.o \
  172. atanhl.o \
  173. atanl.o \
  174. cargl.o \
  175. cbrtl.o \
  176. ceill.o \
  177. copysignl.o \
  178. coshl.o \
  179. cosl.o \
  180. erfcl.o \
  181. erfl.o \
  182. exp2l.o \
  183. expl.o \
  184. expm1l.o \
  185. fabsl.o \
  186. fdiml.o \
  187. floorl.o \
  188. fmal.o \
  189. fmaxl.o \
  190. fminl.o \
  191. fmodl.o \
  192. frexpl.o \
  193. gammal.o \
  194. hypotl.o \
  195. ilogbl.o \
  196. ldexpl.o \
  197. lgammal.o \
  198. llrintl.o \
  199. llroundl.o \
  200. log10l.o \
  201. log1pl.o \
  202. log2l.o \
  203. logbl.o \
  204. logl.o \
  205. lrintl.o \
  206. lroundl.o \
  207. modfl.o \
  208. nearbyintl.o \
  209. nextafterl.o \
  210. nexttowardl.o \
  211. powl.o \
  212. remainderl.o \
  213. remquol.o \
  214. rintl.o \
  215. roundl.o \
  216. scalblnl.o \
  217. scalbnl.o \
  218. significandl.o \
  219. sinhl.o \
  220. sinl.o \
  221. sqrtl.o \
  222. tanhl.o \
  223. tanl.o \
  224. tgammal.o \
  225. truncl.o \
  226. # Do not (yet?) implement the long double variants of bessel functions
  227. ifeq (not-yet-implemented-$(DO_XSI_MATH),y)
  228. LD_MOBJ += \
  229. j0l.o \
  230. j1l.o \
  231. jnl.o \
  232. y0l.o \
  233. y1l.o \
  234. ynl.o
  235. endif
  236. else
  237. # This list of math functions was taken from POSIX/IEEE 1003.1b-1993
  238. libm_CSRC := \
  239. s_atan.c s_ceil.c s_cos.c \
  240. s_fabs.c s_floor.c s_frexp.c \
  241. s_ldexp.c s_modf.c s_sin.c \
  242. s_tan.c s_tanh.c \
  243. s_expm1.c s_scalbn.c s_copysign.c e_acos.c e_asin.c e_atan2.c \
  244. k_cos.c e_cosh.c e_exp.c e_fmod.c e_log.c e_log10.c e_pow.c \
  245. k_sin.c e_sinh.c e_sqrt.c k_tan.c e_rem_pio2.c k_rem_pio2.c \
  246. s_finite.c e_exp10.c \
  247. matherr_wrapers.c k_standart.c
  248. # We'll add sqrtf to avoid problems with libstdc++
  249. FL_MOBJ := sqrtf.o
  250. endif
  251. ifeq ($(DO_XSI_MATH),y)
  252. libm_CSRC += e_j0.c e_j1.c e_jn.c
  253. endif
  254. # assume that arch specific versions are provided as single sources/objects
  255. ifeq ($(UCLIBC_HAS_FPU),y)
  256. ifeq ($(DO_C99_MATH),y)
  257. ifneq ($(strip $(libm_ARCH_OBJS)),)
  258. # remove generic sources, if arch specific version is present
  259. ifneq ($(strip $(libm_ARCH_SRC)),)
  260. libm_CSRC := $(filter-out $(notdir $(libm_ARCH_SRC)),$(libm_CSRC))
  261. endif
  262. # remove generic objects built from multi-sources, if arch specific version is present
  263. FL_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(FL_MOBJ))
  264. LD_MOBJ := $(filter-out $(notdir $(libm_ARCH_OBJS)),$(LD_MOBJ))
  265. # we also try to remove % if s_% is in arch specific subdir
  266. FL_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(FL_MOBJ))
  267. LD_MOBJ := $(filter-out $(patsubst s_%.o,%.o,$(notdir $(libm_ARCH_OBJS))),$(LD_MOBJ))
  268. endif
  269. endif
  270. endif
  271. libm_SRC := $(patsubst %.c,$(libm_DIR)/%.c,$(libm_CSRC))
  272. libm_OBJ := $(patsubst $(libm_DIR)/%.c,$(libm_OUT)/%.o,$(libm_SRC))
  273. ifeq ($(strip $(UCLIBC_HAS_LONG_DOUBLE_MATH)),y)
  274. libm_MSRC_LD := $(libm_DIR)/$(LD_MSRC)
  275. libm_MOBJ_LD := $(patsubst %.o,$(libm_OUT)/%.o,$(LD_MOBJ))
  276. endif
  277. libm_MSRC_FL := $(libm_DIR)/$(FL_MSRC)
  278. libm_MOBJ_FL := $(patsubst %.o,$(libm_OUT)/%.o,$(FL_MOBJ))
  279. libm_OBJS := $(libm_OBJ) $(libm_MOBJ_FL) $(libm_MOBJ_LD)
  280. ifeq ($(DOPIC),y)
  281. libm-a-y += $(libm_OBJS:.o=.os)
  282. else
  283. libm-a-y += $(libm_OBJS)
  284. endif
  285. libm-so-y += $(libm_OBJS:.o=.os)
  286. objclean-y += CLEAN_libm
  287. $(libm_OUT)/libm.oS: $(libm_SRC) $(libm_MSRC_FL) $(libm_MSRC_LD) $(libm_ARCH_SRC)
  288. $(Q)$(RM) $@
  289. $(compile-m)
  290. $(libm_MOBJ_FL): $(libm_MSRC_FL)
  291. $(compile.m)
  292. $(libm_MOBJ_LD): $(libm_MSRC_LD)
  293. $(compile.m)
  294. $(libm_MOBJ_FL:.o=.os): $(libm_MSRC_FL)
  295. $(compile.m)
  296. $(libm_MOBJ_LD:.o=.os): $(libm_MSRC_LD)
  297. $(compile.m)
  298. # spare us from adding a gazillion dummy two-liner files
  299. $(libm_MOBJ_FL:.o=.i): $(libm_MSRC_FL)
  300. $(compile.mi)
  301. $(libm_MOBJ_LD:.o=.i): $(libm_MSRC_LD)
  302. $(compile.mi)
  303. CLEAN_libm:
  304. $(do_rm) $(addprefix $(libm_OUT)/,$(foreach e, o os oS a,$(foreach d, *. */*. */*/*.,$(d)$(e))))