1# Copyright 2000-2020 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
12# Since we do not require GNU "make", let's select the POSIX behavior to
13# uniformize the behavior a bit more with various "make" implementations
14# and ease maintenance. This target should be removed only if one day,
15# we need to require GNU "make".
16.POSIX:
17
18AUTOMAKE_OPTIONS = gnu
19
20# ACLOCAL_AMFLAGS will be fully deprecated in Automake 2.0;
21# AC_CONFIG_MACRO_DIRS (introduced in Automake 1.13) is now used instead,
22# but we still set ACLOCAL_AMFLAGS to avoid a warning message from
23# libtoolize and in case some developer needs to switch back to an
24# old Automake version.
25ACLOCAL_AMFLAGS = -I m4
26
27SUBDIRS = doc src tests tune tools/bench
28
29pkgconfigdir = $(libdir)/pkgconfig
30pkgconfig_DATA = mpfr.pc
31
32nobase_dist_doc_DATA = AUTHORS BUGS COPYING COPYING.LESSER NEWS TODO \
33  examples/ReadMe examples/can_round.c examples/divworst.c \
34  examples/rndo-add.c examples/sample.c examples/threads.c \
35  examples/version.c
36
37EXTRA_DIST = PATCHES VERSION doc/README.dev doc/check-typography doc/mini-gmp \
38  tools/check_mparam.c tools/ck-clz_tab tools/ck-copyright-notice \
39  tools/ck-mparam tools/ck-news tools/ck-version-info tools/get_patches.sh \
40  $(DATAFILES)
41
42bench:
43	cd tools/bench && $(MAKE) $(AM_MAKEFLAGS) bench
44
45# Various checks for "make dist" / "make distcheck".
46# Warning! With "make distcheck", neither the top-level directory nor
47# the tools directory is writable.
48# * Check consistency concerning -version-info. Moreover if the VERSION
49#   file doesn't end with "-dev", check that the -version-info value is
50#   up-to-date. Note: this is a heuristic, to detect some mistakes.
51# * Check that copyright notices exist and appear to be correct.
52# * Check the NEWS file.
53# * Check the __clz_tab sizes.
54# * Check the mparam.h files.
55# * Check typography in mpfr.texi (Texinfo rules).
56dist-hook:
57	cd $(srcdir) && tools/ck-version-info
58	cd $(srcdir) && tools/ck-copyright-notice
59	cd $(srcdir) && tools/ck-news
60	cd $(srcdir) && tools/ck-clz_tab
61	$(srcdir)/tools/ck-mparam
62	cd $(srcdir)/doc && ./check-typography
63
64# Check that MPFR does not use GMP internal symbols. Of course, do not run
65# this rule if you use --with-gmp-build or --enable-gmp-internals.
66# This test does nothing if no libmpfr.so is generated.
67check-gmp-symbols:
68	cd src && $(MAKE) check-gmp-symbols
69
70# Check that MPFR does not define symbols with a GMP reserved prefix.
71# This test does nothing if no libmpfr.so is generated.
72check-exported-symbols:
73	cd src && $(MAKE) check-exported-symbols
74
75.PHONY: check-gmp-symbols check-exported-symbols
76