github.com/aergoio/aergo@v1.3.1/libtool/src/gmp-6.1.2/tune/Makefile.am (about) 1 ## Process this file with automake to generate Makefile.in 2 3 # Copyright 2000-2003, 2005-2011 Free Software Foundation, Inc. 4 # 5 # This file is part of the GNU MP Library. 6 # 7 # The GNU MP Library is free software; you can redistribute it and/or modify 8 # it under the terms of either: 9 # 10 # * the GNU Lesser General Public License as published by the Free 11 # Software Foundation; either version 3 of the License, or (at your 12 # option) any later version. 13 # 14 # or 15 # 16 # * the GNU General Public License as published by the Free Software 17 # Foundation; either version 2 of the License, or (at your option) any 18 # later version. 19 # 20 # or both in parallel, as here. 21 # 22 # The GNU MP Library is distributed in the hope that it will be useful, but 23 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 24 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25 # for more details. 26 # 27 # You should have received copies of the GNU General Public License and the 28 # GNU Lesser General Public License along with the GNU MP Library. If not, 29 # see https://www.gnu.org/licenses/. 30 31 32 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/tests 33 34 EXTRA_DIST = alpha.asm pentium.asm sparcv9.asm hppa.asm hppa2.asm hppa2w.asm \ 35 ia64.asm powerpc.asm powerpc64.asm x86_64.asm many.pl 36 noinst_HEADERS = speed.h 37 38 # Prefer -static on the speed and tune programs, since that can avoid 39 # overheads of shared library linkages on some systems. Libtool tends to 40 # botch -static if configured with --disable-static, perhaps reasonably 41 # enough. In any event under --disable-static the only choice is a dynamic 42 # link so there's no point in -static. 43 # 44 if ENABLE_STATIC 45 STATIC = -static 46 else 47 STATIC = 48 endif 49 50 51 EXTRA_LTLIBRARIES = libspeed.la 52 53 libspeed_la_SOURCES = \ 54 common.c divrem1div.c divrem1inv.c divrem2div.c divrem2inv.c \ 55 div_qr_1n_pi1_1.c div_qr_1n_pi1_2.c div_qr_1_tune.c \ 56 freq.c \ 57 gcdext_single.c gcdext_double.c gcdextod.c gcdextos.c \ 58 hgcd_lehmer.c hgcd_appr_lehmer.c hgcd_reduce_1.c hgcd_reduce_2.c \ 59 jacbase1.c jacbase2.c jacbase3.c jacbase4.c \ 60 mod_1_div.c mod_1_inv.c mod_1_1-1.c mod_1_1-2.c modlinv.c \ 61 noop.c powm_mod.c powm_redc.c pre_divrem_1.c \ 62 set_strb.c set_strs.c set_strp.c time.c 63 64 libspeed_la_DEPENDENCIES = $(SPEED_CYCLECOUNTER_OBJ) \ 65 $(top_builddir)/tests/libtests.la $(top_builddir)/libgmp.la 66 libspeed_la_LIBADD = $(libspeed_la_DEPENDENCIES) $(LIBM) 67 libspeed_la_LDFLAGS = $(STATIC) 68 69 $(top_builddir)/tests/libtests.la: 70 cd $(top_builddir)/tests; $(MAKE) $(AM_MAKEFLAGS) libtests.la 71 72 73 # The library code is faster static than shared on some systems, so do 74 # tuning and measuring with static, since users who care about maximizing 75 # speed will be using that. speed-dynamic exists to show the difference. 76 # 77 # On Solaris 8, gcc 2.95.2 -static is somehow broken (it creates executables 78 # that immediately seg fault), so -all-static is not used. The only thing 79 # -all-static does is make libc static linked as well as libgmp, and that 80 # makes a difference only when measuring malloc and friends in the speed 81 # program. This can always be forced with "make speed_LDFLAGS=-all-static 82 # ..." if desired, see tune/README. 83 84 EXTRA_PROGRAMS = speed speed-dynamic speed-ext tuneup tune-gcd-p 85 86 DEPENDENCIES = libspeed.la 87 LDADD = $(DEPENDENCIES) $(TUNE_LIBS) 88 89 speed_SOURCES = speed.c 90 speed_LDFLAGS = $(STATIC) 91 92 speed_dynamic_SOURCES = speed.c 93 94 speed_ext_SOURCES = speed-ext.c 95 speed_ext_LDFLAGS = $(STATIC) 96 97 tuneup_SOURCES = tuneup.c 98 nodist_tuneup_SOURCES = sqr_basecase.c fac_ui.c $(TUNE_MPN_SRCS) 99 tuneup_DEPENDENCIES = $(TUNE_SQR_OBJ) libspeed.la 100 tuneup_LDADD = $(tuneup_DEPENDENCIES) $(TUNE_LIBS) 101 tuneup_LDFLAGS = $(STATIC) 102 103 tune_gcd_p_SOURCES = tune-gcd-p.c 104 tune_gcd_p_DEPENDENCIES = ../mpn/gcd.c 105 tune_gcd_p_LDFLAGS = $(STATIC) 106 107 108 tune: 109 $(MAKE) $(AM_MAKEFLAGS) tuneup$(EXEEXT) 110 ./tuneup 111 112 allprogs: $(EXTRA_PROGRAMS) 113 114 # $(MANY_CLEAN) and $(MANY_DISTCLEAN) are hooks for many.pl 115 CLEANFILES = $(EXTRA_PROGRAMS) $(EXTRA_LTLIBRARIES) \ 116 $(TUNE_MPN_SRCS) fac_ui.c sqr_asm.asm \ 117 stg.gnuplot stg.data \ 118 mtg.gnuplot mtg.data \ 119 fibg.gnuplot fibg.data \ 120 graph.gnuplot graph.data \ 121 $(MANY_CLEAN) 122 DISTCLEANFILES = sqr_basecase.c $(MANY_DISTCLEAN) 123 124 125 # Generating these little files at build time seems better than including 126 # them in the distribution, since the list can be changed more easily. 127 # 128 # mpn/generic/tdiv_qr.c uses mpn_divrem_1 and mpn_divrem_2, but only for 1 129 # and 2 limb divisors, which are never used during tuning, so it doesn't 130 # matter whether it picks up a tuned or untuned version of those. 131 # 132 # divrem_1 and mod_1 are recompiled renamed to "_tune" to avoid a linking 133 # problem. If a native divrem_1 provides an mpn_divrem_1c entrypoint then 134 # common.c will want that, but the generic divrem_1 doesn't provide it, 135 # likewise for mod_1. The simplest way around this is to have the tune 136 # build versions renamed suitably. 137 # 138 # FIXME: Would like say mul_n.c to depend on $(top_builddir)/mul_n.c so the 139 # recompiled object will be rebuilt if that file changes. 140 141 TUNE_MPN_SRCS = $(TUNE_MPN_SRCS_BASIC) divrem_1.c mod_1.c 142 TUNE_MPN_SRCS_BASIC = div_qr_2.c bdiv_q.c bdiv_qr.c \ 143 dcpi1_div_qr.c dcpi1_divappr_q.c dcpi1_bdiv_qr.c dcpi1_bdiv_q.c \ 144 invertappr.c invert.c binvert.c divrem_2.c gcd.c gcdext.c \ 145 get_str.c set_str.c matrix22_mul.c \ 146 hgcd.c hgcd_appr.c hgcd_reduce.c \ 147 mul_n.c sqr.c sec_powm.c \ 148 mullo_n.c mul_fft.c mul.c tdiv_qr.c mulmod_bnm1.c sqrmod_bnm1.c \ 149 mulmid.c mulmid_n.c toom42_mulmid.c sqrlo.c sqrlo_basecase.c \ 150 nussbaumer_mul.c toom6h_mul.c toom8h_mul.c toom6_sqr.c toom8_sqr.c \ 151 toom22_mul.c toom2_sqr.c toom33_mul.c toom3_sqr.c toom44_mul.c toom4_sqr.c 152 153 $(TUNE_MPN_SRCS_BASIC): 154 for i in $(TUNE_MPN_SRCS_BASIC); do \ 155 echo "#define TUNE_PROGRAM_BUILD 1" >$$i; \ 156 echo "#include \"mpn/generic/$$i\"" >>$$i; \ 157 done 158 159 divrem_1.c: 160 echo "#define TUNE_PROGRAM_BUILD 1" >divrem_1.c 161 echo "#define __gmpn_divrem_1 mpn_divrem_1_tune" >>divrem_1.c 162 echo "#include \"mpn/generic/divrem_1.c\"" >>divrem_1.c 163 164 mod_1.c: 165 echo "#define TUNE_PROGRAM_BUILD 1" >mod_1.c 166 echo "#define __gmpn_mod_1 mpn_mod_1_tune" >>mod_1.c 167 echo "#include \"mpn/generic/mod_1.c\"" >>mod_1.c 168 169 sqr_asm.asm: $(top_builddir)/mpn/sqr_basecase.asm 170 echo 'define(SQR_TOOM2_THRESHOLD_OVERRIDE,SQR_TOOM2_THRESHOLD_MAX)' >sqr_asm.asm 171 echo 'include(../mpn/sqr_basecase.asm)' >>sqr_asm.asm 172 173 # FIXME: Should it depend on $(top_builddir)/fac_ui.h too? 174 fac_ui.c: $(top_builddir)/mpz/fac_ui.c 175 echo "#define TUNE_PROGRAM_BUILD 1" >fac_ui.c 176 echo "#define __gmpz_fac_ui mpz_fac_ui_tune" >>fac_ui.c 177 echo "#define __gmpz_oddfac_1 mpz_oddfac_1_tune" >>fac_ui.c 178 echo "#include \"mpz/oddfac_1.c\"" >>fac_ui.c 179 echo "#include \"mpz/fac_ui.c\"" >>fac_ui.c 180 181 include ../mpn/Makeasm.am