1# Copyright 2000-2023 Free Software Foundation, Inc. 2# Contributed by the AriC and Caramba projects, INRIA. 3 4# This file is part of the GNU MPFR Library. 5 6# This Makefile.am is free software; the Free Software Foundation 7# gives unlimited permission to copy and/or distribute it, 8# with or without modifications, as long as this notice is preserved. 9 10# This program is distributed in the hope that it will be useful, 11# but WITHOUT ANY WARRANTY, to the extent permitted by law; without 12# even the implied warranty of MERCHANTABILITY or FITNESS FOR A 13# PARTICULAR PURPOSE. 14 15 16# The ".POSIX" line is needed in particular for GNU "make", so that 17# recipes are invoked as if the shell had been passed the -e flag. 18# But note that since GNU Automake adds non-comment lines before it 19# in its generated Makefile, this does not ensure POSIX behavior with 20# other "make" implementations. 21.POSIX: 22 23EXTRA_DIST = round_raw_generic.c jyn_asympt.c \ 24 add1sp1_extracted.c mul_1_extracted.c sub1sp1_extracted.c \ 25 amd/mparam.h arm/mparam.h \ 26 generic/coverage/mparam.h generic/mparam.h \ 27 mips/mparam.h powerpc64/mparam.h sparc64/mparam.h \ 28 x86/mparam.h x86_64/core2/mparam.h x86_64/mparam.h 29 30include_HEADERS = mpfr.h mpf2mpfr.h 31nodist_include_HEADERS = 32 33BUILT_SOURCES = get_patches.c mparam.h 34 35lib_LTLIBRARIES = libmpfr.la 36 37libmpfr_la_SOURCES = mpfr.h mpf2mpfr.h mpfr-cvers.h mpfr-gmp.h \ 38mpfr-impl.h mpfr-intmax.h mpfr-longlong.h mpfr-sassert.h mpfr-thread.h \ 39exceptions.c extract.c uceil_exp2.c \ 40uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c agm.c clear.c cmp.c \ 41cmpabs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c \ 42div_2ui.c div.c div_ui.c dot.c dump.c eq.c exp10.c exp2.c exp3.c exp.c \ 43frac.c frexp.c get_d.c get_exp.c get_str.c init.c inp_str.c isinteger.c \ 44isinf.c isnan.c isnum.c const_log2.c log.c modf.c mul_2exp.c mul_2si.c \ 45mul_2ui.c mul.c mul_ui.c neg.c next.c out_str.c printf.c vasprintf.c \ 46const_pi.c pow.c pow_si.c pow_ui.c pow_sj.c pow_uj.c print_raw.c \ 47print_rnd_mode.c \ 48reldiff.c round_prec.c set.c setmax.c setmin.c set_d.c set_dfl_prec.c \ 49set_exp.c set_rnd.c set_f.c set_prc_raw.c set_prec.c set_q.c set_si.c \ 50set_str.c set_str_raw.c set_ui.c set_z.c sqrt.c sqrt_ui.c sub.c sub1.c \ 51sub_ui.c rint.c ui_div.c ui_sub.c urandom.c urandomb.c get_z_2exp.c \ 52swap.c factorial.c cosh.c sinh.c tanh.c sinh_cosh.c acosh.c asinh.c \ 53atanh.c atan.c cmp2.c exp_2.c asin.c const_euler.c cos.c sin.c tan.c \ 54fma.c fms.c hypot.c log1p.c expm1.c log2.c log2p1.c log10.c log10p1.c \ 55ui_pow.c ui_pow_ui.c minmax.c dim.c signbit.c copysign.c setsign.c \ 56gmp_op.c init2.c acos.c sin_cos.c set_nan.c set_inf.c set_zero.c \ 57powerof2.c gamma.c set_ld.c get_ld.c cbrt.c volatile.c fits_s.h \ 58fits_sshort.c fits_sint.c fits_slong.c fits_u.h fits_ushort.c \ 59fits_uint.c fits_ulong.c fits_uintmax.c fits_intmax.c get_si.c get_ui.c \ 60zeta.c cmp_d.c erf.c inits.c inits2.c clears.c sgn.c check.c sub1sp.c \ 61version.c mpn_exp.c mpfr-gmp.c mp_clz_tab.c sum.c add1sp.c \ 62free_cache.c si_op.c cmp_ld.c set_ui_2exp.c set_si_2exp.c set_uj.c \ 63set_sj.c get_sj.c get_uj.c get_z.c iszero.c cache.c sqr.c \ 64int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c mulders.c get_f.c \ 65round_p.c erfc.c atan2.c atan2u.c subnormal.c const_catalan.c root.c \ 66gen_inverse.h sec.c csc.c cot.c eint.c sech.c csch.c coth.c \ 67round_near_x.c constant.c abort_prec_max.c stack_interface.c lngamma.c \ 68zeta_ui.c set_d64.c get_d64.c jn.c yn.c rem1.c add_d.c \ 69sub_d.c d_sub.c mul_d.c div_d.c d_div.c li2.c rec_sqrt.c min_prec.c \ 70buildopt.c digamma.c bernoulli.c isregular.c set_flt.c get_flt.c \ 71scale2.c set_z_2exp.c ai.c gammaonethird.c ieee_floats.h \ 72grandom.c fpif.c set_float128.c get_float128.c rndna.c nrandom.c \ 73random_deviate.h random_deviate.c erandom.c mpfr-mini-gmp.c \ 74mpfr-mini-gmp.h fmma.c log_ui.c gamma_inc.c ubf.c invert_limb.h \ 75invsqrt_limb.h beta.c odd_p.c get_q.c pool.c total_order.c set_d128.c \ 76get_d128.c nbits_ulong.c cmpabs_ui.c sinu.c cosu.c tanu.c fmod_ui.c \ 77acosu.c asinu.c atanu.c compound.c exp2m1.c exp10m1.c powr.c 78 79nodist_libmpfr_la_SOURCES = $(BUILT_SOURCES) 80 81libmpfr_la_LIBADD = @LIBOBJS@ 82 83# Libtool -version-info CURRENT[:REVISION[:AGE]] for libmpfr.la 84# 85# 1. No interfaces changed, only implementations (good): 86# ==> Increment REVISION. 87# 2. Interfaces added, none removed (good): 88# ==> Increment CURRENT, increment AGE, set REVISION to 0. 89# 3. Interfaces removed or changed (BAD, breaks upward compatibility): 90# ==> Increment CURRENT, set AGE and REVISION to 0. 91# 92# For each new MPFR major-minor version, add a new line below with the 93# corresponding -version-info CURRENT and AGE. This will be checked by 94# the tools/ck-version-info script. 95# 96# MPFR -version-info 97# 2.1.x - 98# 2.2.x 1:x:0 99# 2.3.x 2:x:1 100# 2.4.x 3:x:2 101# 3.0.x 4:x:0 102# 3.1.x 5:x:1 103# 4.0.x 6:x:0 104# 4.1.x 7:x:1 105# 4.2.x 8:x:2 106libmpfr_la_LDFLAGS = $(MPFR_LDFLAGS) $(LIBMPFR_LDFLAGS) -version-info 8:0:2 107 108GET_PATCHES_SH = $(top_srcdir)/tools/get_patches.sh 109PATCHES = $(top_srcdir)/PATCHES 110get_patches.c: $(GET_PATCHES_SH) $(PATCHES) 111 $(GET_PATCHES_SH) $(PATCHES) > $@ || { rm -f $@; exit 1; } 112 113if MINI_GMP 114 115# The mini-gmp.{c,h} files are external files, not part of MPFR, thus they 116# must not be put in the tarballs by "make dist". Hence the use of nodist_ 117# on the corresponding sources (this is needed even when --with-mini-gmp 118# has not been used). 119nodist_include_HEADERS += mini-gmp.h 120 121# The noinst_ below seems OK as libminigmp should be included in libmpfr, 122# and this is confirmed by ldd (replacing noinst_ by lib_ does not seem to 123# do this and makes linking of the test programs fail). 124noinst_LTLIBRARIES = libminigmp.la 125nodist_libminigmp_la_SOURCES = mini-gmp.h mini-gmp.c 126libmpfr_la_LIBADD += libminigmp.la 127 128DISTCLEANFILES = $(nodist_libminigmp_la_SOURCES) 129 130endif 131 132# For check-gmp-symbols 133GMPC = $(top_builddir)/src/gmp.c 134GMPI = $(top_builddir)/src/gmp.i 135 136# For check-gmp-symbols and check-exported-symbols (if the library does 137# not have this name, e.g. on some platforms or when the shared library 138# is disabled, these rules do nothing). 139LIBMPFRSO = $(top_builddir)/src/.libs/libmpfr.so 140 141# Check that MPFR does not use GMP internal symbols. Of course, do not run 142# this rule if you use --with-gmp-build or --enable-gmp-internals. This 143# test does nothing if --disable-shared has been used. 144# Note: we use a temporary file $(GMPC) instead of "| $(COMPILE) -E -" 145# because the latter is not supported by all compilers (at least under 146# MS Windows). 147check-gmp-symbols: $(LTLIBRARIES) 148 if [ -f "$(LIBMPFRSO)" ]; then \ 149 printf "#include <%s.h>\n" stdarg stdio gmp > $(GMPC) && \ 150 $(COMPILE) -E $(GMPC) > $(GMPI) || exit 1; \ 151 internals=`$(NM) -u "$(LIBMPFRSO)" | \ 152 $(SED) -n 's/^ *U \(__gmp.*\)/\1/p' | \ 153 while read s; \ 154 do \ 155 $(GREP) -q "$$s[ (;]" $(GMPI) || echo "$$s"; \ 156 done`; \ 157 if [ -n "$$internals" ]; then \ 158 echo "Internal GMP symbols:" $$internals; \ 159 exit 1; \ 160 fi; \ 161 rm $(GMPC) $(GMPI); \ 162 fi 163 164# Check that MPFR does not define symbols with a GMP reserved prefix. 165# For instance, with r11968, and 166# ./configure --with-gmp-build=... CC=tcc 167# the symbol __gmpn_clz_tab is defined, which is wrong. 168# Note: the "$(GREP) -v '@plt$$'" below is for tcc. 169check-exported-symbols: $(LTLIBRARIES) 170 if [ -f "$(LIBMPFRSO)" ]; then \ 171 gsymbols=`$(NM) -gP "$(LIBMPFRSO)" | perl -ne \ 172 '/^(__gmp[a-z]?_[_0-9A-Za-z]*) +[A-TV-Z]/ and print " $$1"' | \ 173 { $(GREP) -v '@plt$$' || true ; }`; \ 174 if [ -n "$$gsymbols" ]; then \ 175 echo "MPFR defines symbols with a GMP reserved prefix:$$gsymbols"; \ 176 exit 1; \ 177 fi; \ 178 fi 179 180CLEANFILES = get_patches.c $(GMPC) $(GMPI) 181 182.PHONY: check-gmp-symbols check-exported-symbols 183