Makefile.am.in 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ## Makefile.am.in - process this file to produce Makefile.am
  2. ## Copyright (C) 2015-2021 Alex Vong <alexvong1995 AT protonmail DOT com>
  3. ##
  4. ## This program is free software; you can redistribute it and/or
  5. ## modify it under the terms of the GNU General Public License
  6. ## as published by the Free Software Foundation; either version 2
  7. ## of the License, or (at your option) any later version.
  8. ##
  9. ## This program is distributed in the hope that it will be useful,
  10. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ## GNU General Public License for more details.
  13. ##
  14. ## You should have received a copy of the GNU General Public License
  15. ## along with this program; if not, write to the Free Software Foundation,
  16. ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. ACLOCAL_AMFLAGS = -I m4
  18. SRCS = @SRCS@
  19. TESTS = tests/spot-check tests/fermat-test tests/self-test
  20. dist_check_SCRIPTS = $(TESTS)
  21. EXTRA_DIST = .debian upstream Makefile.am.in
  22. dist_noinst_SCRIPTS = bootstrap doc/manpage.pl scripts/mlucas.in
  23. dist_man_MANS = doc/mlucas.1
  24. bin_SCRIPTS = mlucas primenet
  25. mlucas: scripts/mlucas.in
  26. $(AM_V_GEN) $(SED) \
  27. -e 's,[@]pkglibexecdir[@],$(pkglibexecdir),g' \
  28. -e 's,[@]host_cpu[@],$(host_cpu),g' \
  29. < scripts/mlucas.in > mlucas \
  30. && $(CHMOD) +x mlucas
  31. primenet: ./upstream/primenet.py
  32. $(AM_V_GEN) $(SED) \
  33. -e 's,#!/usr/bin/env python,#!/usr/bin/python3,' \
  34. <./upstream/primenet.py >./primenet \
  35. && $(CHMOD) +x ./primenet
  36. pkglibexec_PROGRAMS =
  37. if BUILD_GENERIC_C
  38. pkglibexec_PROGRAMS += mlucas-generic-c
  39. mlucas_generic_c_SOURCES = $(SRCS)
  40. mlucas_generic_c_CFLAGS = $(EXTRACFLAGS)
  41. mlucas_generic_c_LDFLAGS = $(EXTRALDFLAGS)
  42. mlucas_generic_c_LIBS = $(EXTRALIBS)
  43. endif
  44. if BUILD_SSE2
  45. pkglibexec_PROGRAMS += mlucas-sse2
  46. mlucas_sse2_SOURCES = $(SRCS)
  47. mlucas_sse2_CPPFLAGS = -DUSE_SSE2
  48. mlucas_sse2_CFLAGS = $(EXTRACFLAGS) -msse2
  49. mlucas_sse2_LDFLAGS = $(EXTRALDFLAGS)
  50. mlucas_sse2_LIBS = $(EXTRALIBS)
  51. endif
  52. if BUILD_AVX
  53. pkglibexec_PROGRAMS += mlucas-avx
  54. mlucas_avx_SOURCES = $(SRCS)
  55. mlucas_avx_CPPFLAGS = -DUSE_AVX
  56. mlucas_avx_CFLAGS = $(EXTRACFLAGS) -mavx
  57. mlucas_avx_LDFLAGS = $(EXTRALDFLAGS)
  58. mlucas_avx_LIBS = $(EXTRALIBS)
  59. endif
  60. if BUILD_AVX2
  61. pkglibexec_PROGRAMS += mlucas-avx2
  62. mlucas_avx2_SOURCES = $(SRCS)
  63. mlucas_avx2_CPPFLAGS = -DUSE_AVX2
  64. mlucas_avx2_CFLAGS = $(EXTRACFLAGS) -mavx2
  65. mlucas_avx2_LDFLAGS = $(EXTRALDFLAGS)
  66. mlucas_avx2_LIBS = $(EXTRALIBS)
  67. endif
  68. if BUILD_AVX512
  69. pkglibexec_PROGRAMS += mlucas-avx512
  70. mlucas_avx512_SOURCES = $(SRCS)
  71. mlucas_avx512_CPPFLAGS = -DUSE_AVX512
  72. mlucas_avx512_CFLAGS = $(EXTRACFLAGS) -mavx512f -mavx512cd
  73. mlucas_avx512_LDFLAGS = $(EXTRALDFLAGS)
  74. mlucas_avx512_LIBS = $(EXTRALIBS)
  75. endif
  76. if BUILD_ARM_V8_SIMD
  77. pkglibexec_PROGRAMS += mlucas-arm-v8-simd
  78. mlucas_arm_v8_simd_SOURCES = $(SRCS)
  79. mlucas_arm_v8_simd_CPPFLAGS = -DUSE_ARM_V8_SIMD
  80. mlucas_arm_v8_simd_CFLAGS = $(EXTRACFLAGS)
  81. mlucas_arm_v8_simd_LDFLAGS = $(EXTRALDFLAGS)
  82. mlucas_arm_v8_simd_LIBS = $(EXTRALIBS)
  83. endif
  84. MOSTLYCLEANFILES = *.cfg
  85. CLEANFILES = mlucas