xref: /netbsd-src/external/lgpl3/mpfr/dist/tests/Makefile.am (revision 6a493d6bc668897c91594964a732d38505b70cbb)
1# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc.
2# This Makefile.am is free software; the Free Software Foundation
3# gives unlimited permission to copy and/or distribute it,
4# with or without modifications, as long as this notice is preserved.
5
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
8# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
9# PARTICULAR PURPOSE.
10
11
12AUTOMAKE_OPTIONS = 1.6 gnu
13
14# tversion is run
15#   * at the beginning so that the user gets a possible version error
16#     before any other one (the version error may be the cause of the
17#     other errors), and
18#   * at the end so that the error message is also near the end of the
19#     output.
20check_PROGRAMS = tversion tinternals tinits tisqrt tsgn tcheck	\
21     tisnan texceptions tset_exp tset mpf_compat mpfr_compat	\
22     reuse tabs tacos tacosh tadd tadd1sp tadd_d tadd_ui tagm	\
23     tai tasin tasinh tatan tatanh taway tbuildopt tcan_round	\
24     tcbrt tcmp tcmp2 tcmp_d tcmp_ld tcmp_ui tcmpabs		\
25     tcomparisons tconst_catalan tconst_euler tconst_log2	\
26     tconst_pi tcopysign tcos tcosh tcot tcoth tcsc tcsch	\
27     td_div td_sub tdigamma tdim tdiv tdiv_d tdiv_ui teint teq	\
28     terf texp texp10 texp2 texpm1 tfactorial tfits tfma tfmod	\
29     tfms tfprintf tfrac tfrexp tgamma tget_flt tget_d tget_d_2exp \
30     tget_f tget_ld_2exp tget_set_d64 tget_sj tget_str tget_z	\
31     tgmpop tgrandom thyperbolic thypot tinp_str tj0 tj1 tjn tl2b	\
32     tlgamma tli2 tlngamma tlog tlog10 tlog1p tlog2 tmin_prec	\
33     tminmax tmodf tmul tmul_2exp tmul_d tmul_ui tnext		\
34     tout_str toutimpl tpow tpow3 tpow_all tpow_z tprintf	\
35     trandom trec_sqrt tremquo trint troot tround_prec tsec	\
36     tsech tset_d tset_f tset_ld tset_q tset_si tset_sj		\
37     tset_str tset_z tset_z_exp tsi_op tsin tsin_cos tsinh	\
38     tsinh_cosh tsprintf tsqr tsqrt tsqrt_ui tstckintc tstdint tstrtofr	\
39     tsub tsub1sp tsub_d tsub_ui tsubnormal tsum tswap ttan	\
40     ttanh ttrunc tui_div tui_pow tui_sub turandom 	 \
41      tvalist ty0 ty1 tyn tzeta tzeta_ui tversion
42
43AM_CPPFLAGS = -DSRCDIR='"$(srcdir)"'
44
45EXTRA_DIST = tgeneric.c tgeneric_ui.c mpf_compat.h inp_str.data tmul.dat
46
47LDADD = libfrtests.la $(MPFR_LIBM) $(top_builddir)/src/libmpfr.la
48INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
49
50# LOADLIBES (documented in the "GNU make" manual and equivalent to LDLIBS)
51# enables to compile a program foo.c in the test directory by simply doing
52# "make foo".
53# Warning! This is not guaranteed to work, as libtool is not used. In
54# particular, this may not work as expected under GNU/Linux if --with-gmp
55# has been used, unless the directory is in your $LD_LIBRARY_PATH.
56# Moreover, dependencies are not tracked. Thus you may want to run
57# "make tversion" (for instance) just before, to make sure that every
58# dependency has been rebuilt.
59LOADLIBES=$(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(top_builddir)/tests/.libs/libfrtests.a $(top_builddir)/src/.libs/libmpfr.a $(LIBS) $(MPFR_LIBM)
60
61check_LTLIBRARIES = libfrtests.la
62libfrtests_la_SOURCES = mpfr-test.h memory.c rnd_mode.c tests.c cmp_str.c random2.c
63
64$(top_builddir)/src/libmpfr.la:
65	cd $(top_builddir)/src && $(MAKE) $(AM_MAKEFLAGS) libmpfr.la
66
67TESTS = $(check_PROGRAMS)
68TESTS_ENVIRONMENT = MPFR_QUIET=1 $(VALGRIND)
69
70# The -no-install option prevents libtool from generating wrapper scripts
71# for the tests.
72# This is useful to easily run the test scripts under valgrind or gdb.
73# See discussion http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/28033
74# http://article.gmane.org/gmane.comp.lib.gnulib.bugs/28140 in particular.
75#
76# The -L$(top_builddir)/src/.libs option is necessary for some platforms,
77# such as HP-UX, when --with-gmp or --with-gmp-lib is used and an old MPFR
78# library is already installed in the corresponding lib directory: its
79# purpose is to make sure that the local .libs comes first in the library
80# search path (otherwise the tests are linked against the old MPFR library
81# by the LINK command -- see the generated Makefile). See:
82#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00042.html
83#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00043.html
84#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00044.html
85#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00066.html
86#   https://sympa.inria.fr/sympa/arc/mpfr/2011-10/msg00065.html
87# and
88#   http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9728
89#
90AM_LDFLAGS = -no-install -L$(top_builddir)/src/.libs
91