Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 1 | # Copyright (C) 2007 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
The Android Open Source Project | b07e1d9 | 2009-03-03 19:29:30 -0800 | [diff] [blame] | 14 | |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 15 | LOCAL_PATH:= $(call my-dir) |
| 16 | |
| 17 | # |
| 18 | # Common definitions for host and device. |
| 19 | # |
| 20 | |
| 21 | src_files := \ |
The Android Open Source Project | b07e1d9 | 2009-03-03 19:29:30 -0800 | [diff] [blame] | 22 | k_standard.c k_rem_pio2.c \ |
| 23 | k_cos.c k_sin.c k_tan.c \ |
| 24 | e_acos.c e_acosh.c e_asin.c e_atan2.c \ |
| 25 | e_atanh.c e_cosh.c e_exp.c e_fmod.c \ |
| 26 | e_gamma.c e_gamma_r.c e_hypot.c e_j0.c \ |
| 27 | e_j1.c e_jn.c e_lgamma.c e_lgamma_r.c \ |
| 28 | e_log.c e_log10.c e_pow.c e_rem_pio2.c e_remainder.c \ |
| 29 | e_scalb.c e_sinh.c e_sqrt.c \ |
| 30 | w_acos.c w_acosh.c w_asin.c w_atan2.c \ |
| 31 | w_atanh.c w_cosh.c w_exp.c w_fmod.c \ |
| 32 | w_gamma.c w_gamma_r.c w_hypot.c w_j0.c \ |
| 33 | w_j1.c w_jn.c w_lgamma.c w_lgamma_r.c \ |
| 34 | w_log.c w_log10.c w_pow.c w_remainder.c \ |
| 35 | w_scalb.c w_sinh.c w_sqrt.c \ |
| 36 | s_asinh.c s_atan.c s_cbrt.c s_ceil.c s_copysign.c \ |
| 37 | s_cos.c s_erf.c s_expm1.c s_fabs.c s_finite.c s_floor.c \ |
| 38 | s_frexp.c s_ilogb.c s_isnan.c s_ldexp.c s_lib_version.c \ |
| 39 | s_log1p.c s_logb.c s_matherr.c s_modf.c s_nextafter.c \ |
| 40 | s_rint.c s_scalbn.c s_signgam.c s_significand.c s_sin.c \ |
| 41 | s_tan.c s_tanh.c |
| 42 | |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 43 | # This is necessary to guarantee that the FDLIBM functions are in |
| 44 | # "IEEE spirit", i.e. to guarantee that the IEEE 754 core functions |
| 45 | # are used. |
Chris Dearman | 436880f | 2011-05-13 15:25:03 -0700 | [diff] [blame] | 46 | cflags := "-D_IEEE_LIBM" |
The Android Open Source Project | b07e1d9 | 2009-03-03 19:29:30 -0800 | [diff] [blame] | 47 | |
Marcus Oakland | 67cc0e4 | 2013-09-18 10:10:05 +0100 | [diff] [blame] | 48 | # Android only supports little-endian. |
| 49 | cflags += "-D__LITTLE_ENDIAN" |
| 50 | |
Elliott Hughes | 6a0e513 | 2011-01-27 16:09:23 -0800 | [diff] [blame] | 51 | # Disable GCC optimizations that interact badly with this crufty |
| 52 | # library (see their own admission in 'readme'). Without this, we |
| 53 | # fail StrictMath tests on x86. |
| 54 | cflags += "-fno-strict-aliasing" |
| 55 | cflags += "-ffloat-store" |
| 56 | |
Serban Constantinescu | a418ed7 | 2014-10-06 15:49:37 +0100 | [diff] [blame] | 57 | # c99 specifies a less relaxed floating point model that does not enable |
| 58 | # floating point expession contraction (e.g: fused multiply-add operations). |
| 59 | cflags += "-std=c99" |
The Android Open Source Project | b07e1d9 | 2009-03-03 19:29:30 -0800 | [diff] [blame] | 60 | |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 61 | # |
| 62 | # Build for the target (device). |
| 63 | # |
| 64 | |
| 65 | include $(CLEAR_VARS) |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 66 | LOCAL_SRC_FILES:= $(src_files) |
| 67 | LOCAL_CFLAGS := $(cflags) |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 68 | LOCAL_MODULE := libfdlibm |
Chris Dearman | 436880f | 2011-05-13 15:25:03 -0700 | [diff] [blame] | 69 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
The Android Open Source Project | b07e1d9 | 2009-03-03 19:29:30 -0800 | [diff] [blame] | 70 | include $(BUILD_STATIC_LIBRARY) |
Dan Bornstein | 530cace | 2009-10-24 13:21:05 -0700 | [diff] [blame] | 71 | |
| 72 | |
| 73 | # |
| 74 | # Build for the host. |
| 75 | # |
| 76 | |
Ian Rogers | 6948acb | 2014-05-23 11:12:29 -0700 | [diff] [blame] | 77 | include $(CLEAR_VARS) |
| 78 | LOCAL_SRC_FILES:= $(src_files) |
| 79 | LOCAL_CFLAGS := $(cflags) |
| 80 | LOCAL_MODULE := libfdlibm |
| 81 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Ian Rogers | 22b981c | 2014-06-24 20:58:53 -0700 | [diff] [blame] | 82 | LOCAL_MULTILIB := both |
Ian Rogers | 6948acb | 2014-05-23 11:12:29 -0700 | [diff] [blame] | 83 | include $(BUILD_HOST_STATIC_LIBRARY) |