Makefile.am 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. bin_PROGRAMS= scrypt
  2. noinst_PROGRAMS= tests/verify-strings/test_scrypt \
  3. tests/valgrind/potential-memleaks
  4. dist_man_MANS=$(scrypt_man_MANS)
  5. ACLOCAL_AMFLAGS= -I m4
  6. # These files fulfill the crypto_scrypt() function, with the exception of
  7. # libcperciva/alg/sha256_shani.c
  8. # lib/crypto/crypto_scrypt_smix_sse2.c
  9. # which require special compiler flags and are thus compiled as separate
  10. # libraries. See test_scrypt for an example.
  11. crypto_scrypt_files= lib/crypto/crypto_scrypt.c \
  12. lib/crypto/crypto_scrypt.h \
  13. lib/crypto/crypto_scrypt_smix.c \
  14. lib/crypto/crypto_scrypt_smix.h \
  15. lib/crypto/crypto_scrypt_smix_sse2.h \
  16. lib/platform.h \
  17. libcperciva/alg/sha256.c \
  18. libcperciva/alg/sha256.h \
  19. libcperciva/alg/sha256_shani.h \
  20. libcperciva/cpusupport/cpusupport.h \
  21. libcperciva/cpusupport/cpusupport_x86_shani.c \
  22. libcperciva/cpusupport/cpusupport_x86_sse2.c \
  23. libcperciva/cpusupport/cpusupport_x86_ssse3.c \
  24. libcperciva/util/insecure_memzero.c \
  25. libcperciva/util/insecure_memzero.h \
  26. libcperciva/util/warnp.c \
  27. libcperciva/util/warnp.h
  28. scrypt_SOURCES= main.c \
  29. $(crypto_scrypt_files) \
  30. lib/scryptenc/scryptenc.c \
  31. lib/scryptenc/scryptenc.h \
  32. lib/scryptenc/scryptenc_cpuperf.c \
  33. lib/scryptenc/scryptenc_cpuperf.h \
  34. lib/util/memlimit.c \
  35. lib/util/memlimit.h \
  36. libcperciva/cpusupport/cpusupport_x86_aesni.c \
  37. libcperciva/cpusupport/cpusupport_x86_rdrand.c \
  38. libcperciva/crypto/crypto_aes.c \
  39. libcperciva/crypto/crypto_aes.h \
  40. libcperciva/crypto/crypto_aes_aesni.h \
  41. libcperciva/crypto/crypto_aesctr.c \
  42. libcperciva/crypto/crypto_aesctr.h \
  43. libcperciva/crypto/crypto_entropy.c \
  44. libcperciva/crypto/crypto_entropy.h \
  45. libcperciva/crypto/crypto_entropy_rdrand.h \
  46. libcperciva/crypto/crypto_verify_bytes.c \
  47. libcperciva/crypto/crypto_verify_bytes.h \
  48. libcperciva/util/asprintf.c \
  49. libcperciva/util/asprintf.h \
  50. libcperciva/util/entropy.c \
  51. libcperciva/util/entropy.h \
  52. libcperciva/util/getopt.c \
  53. libcperciva/util/getopt.h \
  54. libcperciva/util/humansize.c \
  55. libcperciva/util/humansize.h \
  56. libcperciva/util/monoclock.c \
  57. libcperciva/util/monoclock.h \
  58. libcperciva/util/parsenum.h \
  59. libcperciva/util/readpass.c \
  60. libcperciva/util/readpass.h \
  61. libcperciva/util/sysendian.h
  62. AM_CPPFLAGS= -I$(srcdir)/lib \
  63. -I$(srcdir)/lib/crypto \
  64. -I$(srcdir)/lib/scryptenc \
  65. -I$(srcdir)/lib/util \
  66. -I$(srcdir)/libcperciva/alg \
  67. -I$(srcdir)/libcperciva/cpusupport \
  68. -I$(srcdir)/libcperciva/crypto \
  69. -I$(srcdir)/libcperciva/util \
  70. -DCPUSUPPORT_CONFIG_FILE=\"cpusupport-config.h\" \
  71. -D_POSIX_C_SOURCE=200809L \
  72. -D_XOPEN_SOURCE=700 \
  73. ${CFLAGS_POSIX}
  74. scrypt_LDADD= libcperciva_aesni.la libcperciva_rdrand.la \
  75. libcperciva_shani.la libscrypt_sse2.la \
  76. ${LDADD_POSIX}
  77. scrypt_man_MANS= scrypt.1
  78. cpusupport-config.h:
  79. ( export CC="${CC}"; export CFLAGS="${CFLAGS}"; command -p sh $(srcdir)/libcperciva/cpusupport/Build/cpusupport.sh "$$PATH") > cpusupport-config.h.tmp && command -p mv cpusupport-config.h.tmp cpusupport-config.h
  80. BUILT_SOURCES= cpusupport-config.h
  81. CLEANFILES= cpusupport-config.h cpusupport-config.h.tmp
  82. # Libraries from libcperciva code.
  83. noinst_LTLIBRARIES= libcperciva_aesni.la
  84. libcperciva_aesni_la_SOURCES= libcperciva/crypto/crypto_aes_aesni.c
  85. nodist_libcperciva_aesni_la_SOURCES= cpusupport-config.h
  86. libcperciva_aesni_la_CFLAGS=`. ./cpusupport-config.h; echo $${CFLAGS_X86_AESNI}`
  87. noinst_LTLIBRARIES+= libcperciva_rdrand.la
  88. libcperciva_rdrand_la_SOURCES= libcperciva/crypto/crypto_entropy_rdrand.c
  89. nodist_libcperciva_rdrand_la_SOURCES= cpusupport-config.h
  90. libcperciva_rdrand_la_CFLAGS= \
  91. `. ./cpusupport-config.h; echo $${CFLAGS_X86_RDRAND}`
  92. noinst_LTLIBRARIES+= libcperciva_shani.la
  93. libcperciva_shani_la_SOURCES= libcperciva/alg/sha256_shani.c
  94. nodist_libcperciva_shani_la_SOURCES= cpusupport-config.h
  95. libcperciva_shani_la_CFLAGS=`. ./cpusupport-config.h; echo $${CFLAGS_X86_SHANI} $${CFLAGS_X86_SSSE3}`
  96. # Library from scrypt code.
  97. noinst_LTLIBRARIES+= libscrypt_sse2.la
  98. libscrypt_sse2_la_SOURCES= lib/crypto/crypto_scrypt_smix_sse2.c
  99. nodist_libscrypt_sse2_la_SOURCES= cpusupport-config.h
  100. libscrypt_sse2_la_CFLAGS=`. ./cpusupport-config.h; echo $${CFLAGS_X86_SSE2}`
  101. # Install libscrypt-kdf?
  102. if LIBSCRYPT_KDF
  103. lib_LTLIBRARIES= libscrypt-kdf.la
  104. libscrypt_kdf_la_LDFLAGS= -version-info 1 \
  105. -export-symbols-regex 'crypto_scrypt$$'
  106. include_HEADERS= libscrypt-kdf/scrypt-kdf.h
  107. noinst_PROGRAMS+= tests/libscrypt-kdf/sample-libscrypt-kdf
  108. else
  109. # Allow the user to get a usable library even if they didn't run configure
  110. # with --enable-libscrypt-kdf. If we didn't include this, they would get
  111. # empty libraries if they ran `make libscrypt-kdf.la`.
  112. EXTRA_LTLIBRARIES= libscrypt-kdf.la
  113. endif
  114. # Shared definitions for libscrypt-kdf.
  115. libscrypt_kdf_la_SOURCES= $(crypto_scrypt_files)
  116. libscrypt_kdf_la_LIBADD= libcperciva_shani.la libscrypt_sse2.la
  117. # Workaround for "created with both libtool and without"
  118. libscrypt_kdf_la_CFLAGS= $(AM_CFLAGS)
  119. # Test libscrypt-kdf compile
  120. tests_libscrypt_kdf_sample_libscrypt_kdf_SOURCES= \
  121. tests/libscrypt-kdf/sample-libscrypt-kdf.c
  122. tests_libscrypt_kdf_sample_libscrypt_kdf_CPPFLAGS= \
  123. -I$(srcdir)/libscrypt-kdf/
  124. tests_libscrypt_kdf_sample_libscrypt_kdf_LDADD= libscrypt-kdf.la
  125. EXTRA_DIST = \
  126. COPYRIGHT \
  127. FORMAT \
  128. README.md \
  129. lib/README \
  130. lib/crypto/crypto_scrypt-ref.c \
  131. libcperciva/POSIX/README \
  132. libcperciva/POSIX/posix-cflags.sh \
  133. libcperciva/POSIX/posix-clock_gettime.c \
  134. libcperciva/POSIX/posix-clock_realtime.c \
  135. libcperciva/POSIX/posix-l.c \
  136. libcperciva/POSIX/posix-l.sh \
  137. libcperciva/POSIX/posix-msg_nosignal.c \
  138. libcperciva/POSIX/posix-restrict.c \
  139. libcperciva/cpusupport/Build/cpusupport-X86-AESNI.c \
  140. libcperciva/cpusupport/Build/cpusupport-X86-CPUID.c \
  141. libcperciva/cpusupport/Build/cpusupport-X86-RDRAND.c \
  142. libcperciva/cpusupport/Build/cpusupport-X86-SHANI.c \
  143. libcperciva/cpusupport/Build/cpusupport-X86-SSE2.c \
  144. libcperciva/cpusupport/Build/cpusupport-X86-SSSE3.c \
  145. libcperciva/cpusupport/Build/cpusupport.sh \
  146. tests/01-known-values.sh \
  147. tests/02-decrypt-reference-file.sh \
  148. tests/03-encrypt-decrypt-file.sh \
  149. tests/04-force-resources.sh \
  150. tests/05-system-scrypt-encrypt-decrypt.sh \
  151. tests/shared_test_functions.sh \
  152. tests/test_scrypt.sh \
  153. tests/verify-strings/test_scrypt.good \
  154. tests/verify-strings/test_scrypt_good.enc
  155. # Binary to test the crypto_scrypt() function.
  156. tests_verify_strings_test_scrypt_SOURCES = \
  157. tests/verify-strings/test_scrypt.c \
  158. $(crypto_scrypt_files)
  159. tests_verify_strings_test_scrypt_LDADD= libcperciva_shani.la \
  160. libscrypt_sse2.la \
  161. ${LDADD_POSIX}
  162. # Eliminate false positives while memory-checking for the test framework.
  163. tests_valgrind_potential_memleaks_SOURCES = tests/valgrind/potential-memleaks.c
  164. .PHONY: test
  165. # we can't only build "scrypt tests/verify-strings/test_scrypt" because that
  166. # won't build the BUILT_SOURCES.
  167. test: all
  168. $(top_srcdir)/tests/test_scrypt.sh .