Makefile.in 7.5 KB

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