2018-01-25 23:39:24 +00:00
|
|
|
# https://www.gnu.org/software/make/manual/make.html#Makefile-Conventions
|
2018-02-05 13:54:13 +00:00
|
|
|
# and https://www.gnu.org/prep/standards/standards.html
|
|
|
|
|
2018-01-25 23:39:24 +00:00
|
|
|
SHELL = /bin/sh
|
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# If needed
|
|
|
|
TMPDIR ?= /tmp
|
|
|
|
# Used for feature tests
|
|
|
|
TOUT ?= a.out
|
|
|
|
TOUT := $(strip $(TOUT))
|
|
|
|
|
2019-07-21 06:24:06 +00:00
|
|
|
# Allow override for the cryptest.exe recipe. Change to
|
|
|
|
# ./libcryptopp.so or ./libcryptopp.dylib to suit your
|
|
|
|
# taste. https://github.com/weidai11/cryptopp/issues/866
|
2020-07-30 00:08:17 +00:00
|
|
|
LINK_LIBRARY ?= libcryptopp.a
|
2019-07-21 19:57:26 +00:00
|
|
|
LINK_LIBRARY_PATH ?= ./
|
2019-07-21 06:24:06 +00:00
|
|
|
|
2021-03-09 14:49:51 +00:00
|
|
|
# Default FLAGS if none were provided
|
|
|
|
CPPFLAGS ?= -DNDEBUG
|
|
|
|
CXXFLAGS ?= -g2 -O3 -fPIC -pipe
|
2015-07-31 18:24:49 +00:00
|
|
|
|
2015-12-31 06:43:42 +00:00
|
|
|
AR ?= ar
|
|
|
|
ARFLAGS ?= cr
|
2015-11-05 06:59:46 +00:00
|
|
|
RANLIB ?= ranlib
|
2015-12-31 06:43:42 +00:00
|
|
|
CP ?= cp
|
|
|
|
MV ?= mv
|
|
|
|
CHMOD ?= chmod
|
2018-02-05 13:54:13 +00:00
|
|
|
MKDIR ?= mkdir -p
|
2019-05-21 09:59:58 +00:00
|
|
|
GREP ?= grep
|
2019-05-21 22:48:13 +00:00
|
|
|
SED ?= sed
|
2018-02-05 13:54:13 +00:00
|
|
|
|
2015-12-26 18:57:04 +00:00
|
|
|
LN ?= ln -sf
|
2017-12-16 14:07:23 +00:00
|
|
|
LDCONF ?= /sbin/ldconfig -n
|
2015-07-31 18:24:49 +00:00
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
IS_IOS ?= 0
|
|
|
|
IS_ANDROID ?= 0
|
|
|
|
IS_ARM_EMBEDDED ?= 0
|
2017-09-18 00:07:53 +00:00
|
|
|
|
2020-04-12 14:50:09 +00:00
|
|
|
# Clang is reporting armv8l-unknown-linux-gnueabihf
|
|
|
|
# for ARMv7 images on Aarch64 hardware.
|
2019-05-21 22:48:13 +00:00
|
|
|
MACHINEX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null)
|
|
|
|
HOSTX := $(shell echo $(MACHINEX) | cut -f 1 -d '-')
|
|
|
|
ifeq ($(HOSTX),)
|
|
|
|
HOSTX := $(shell uname -m 2>/dev/null)
|
|
|
|
endif
|
|
|
|
|
|
|
|
IS_LINUX := $(shell echo $(MACHINEX) | $(GREP) -i -c "Linux")
|
2019-05-21 09:59:58 +00:00
|
|
|
|
2021-04-26 08:50:48 +00:00
|
|
|
# Can be used by Android and Embedded cross-compiles. Disable by default because
|
2022-02-10 23:56:24 +00:00
|
|
|
# Android and embedded users typically don't run this configuration.
|
2016-01-05 20:05:29 +00:00
|
|
|
HAS_SOLIB_VERSION ?= 0
|
|
|
|
|
2021-04-26 08:50:48 +00:00
|
|
|
# Formerly adhoc.cpp was created from adhoc.cpp.proto when needed.
|
2018-07-31 17:33:57 +00:00
|
|
|
# This is now needed because ISA tests are performed using adhoc.cpp.
|
|
|
|
ifeq ($(wildcard adhoc.cpp),)
|
|
|
|
$(shell cp adhoc.cpp.proto adhoc.cpp)
|
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
##### General Variables #####
|
|
|
|
###########################################################
|
|
|
|
|
2022-02-10 23:56:24 +00:00
|
|
|
# Needed when the assembler is invoked
|
2022-02-15 03:54:39 +00:00
|
|
|
ifeq ($(findstring -Wa,--noexecstack,$(ASFLAGS)$(CXXFLAGS)),)
|
2022-02-10 23:56:24 +00:00
|
|
|
ASFLAGS += -Wa,--noexecstack
|
|
|
|
endif
|
|
|
|
|
|
|
|
# On ARM we may compile aes_armv4.S, sha1_armv4.S, sha256_armv4.S, and
|
|
|
|
# sha512_armv4.S through the CC compiler
|
|
|
|
ifeq ($(GCC_COMPILER),1)
|
|
|
|
CC ?= gcc
|
|
|
|
else ifeq ($(CLANG_COMPILER),1)
|
|
|
|
CC ?= clang
|
|
|
|
endif
|
|
|
|
|
2015-12-31 06:43:42 +00:00
|
|
|
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
|
2021-05-25 05:21:23 +00:00
|
|
|
ifeq ($(PREFIX),)
|
|
|
|
PREFIX = /usr/local
|
2015-12-31 06:43:42 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(LIBDIR),)
|
2021-05-25 05:21:23 +00:00
|
|
|
LIBDIR := $(PREFIX)/lib
|
2015-12-31 06:43:42 +00:00
|
|
|
endif
|
2021-05-25 05:21:23 +00:00
|
|
|
ifeq ($(DATADIR),)
|
|
|
|
DATADIR := $(PREFIX)/share
|
2015-12-31 06:43:42 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(INCLUDEDIR),)
|
2021-05-25 05:21:23 +00:00
|
|
|
INCLUDEDIR := $(PREFIX)/include
|
|
|
|
endif
|
|
|
|
ifeq ($(BINDIR),)
|
|
|
|
BINDIR := $(PREFIX)/bin
|
2015-12-31 06:43:42 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
# We honor ARFLAGS, but the "v" option used by default causes a noisy make
|
|
|
|
ifeq ($(ARFLAGS),rv)
|
2018-12-01 17:48:47 +00:00
|
|
|
ARFLAGS = r
|
2015-12-31 06:43:42 +00:00
|
|
|
endif
|
|
|
|
|
2021-03-10 16:51:03 +00:00
|
|
|
###########################################################
|
|
|
|
##### MacOS #####
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
# MacOS cross-compile configuration.
|
2022-02-10 23:56:24 +00:00
|
|
|
# See http://www.cryptopp.com/wiki/MacOS_(Command_Line).
|
2021-03-10 16:51:03 +00:00
|
|
|
ifeq ($(IS_MACOS),1)
|
2021-03-10 17:18:38 +00:00
|
|
|
# setenv-macos.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
|
2021-03-20 18:45:51 +00:00
|
|
|
IS_APPLE_LIBTOOL=$(shell libtool -V 2>&1 | $(GREP) -i -c 'Apple')
|
|
|
|
ifeq ($(IS_APPLE_LIBTOOL),1)
|
|
|
|
AR = libtool
|
|
|
|
else
|
|
|
|
AR = /usr/bin/libtool
|
|
|
|
endif
|
2021-03-10 16:51:03 +00:00
|
|
|
ARFLAGS = -static -o
|
|
|
|
endif
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### iOS #####
|
|
|
|
###########################################################
|
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
# iOS cross-compile configuration.
|
2022-02-10 23:56:24 +00:00
|
|
|
# See http://www.cryptopp.com/wiki/iOS_(Command_Line).
|
2015-06-08 11:50:22 +00:00
|
|
|
ifeq ($(IS_IOS),1)
|
2021-03-09 14:49:51 +00:00
|
|
|
# setenv-ios.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
|
2015-06-08 11:50:22 +00:00
|
|
|
AR = libtool
|
|
|
|
ARFLAGS = -static -o
|
|
|
|
endif
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### Android #####
|
|
|
|
###########################################################
|
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
# Android cross-compile configuration.
|
2022-02-10 23:56:24 +00:00
|
|
|
# See http://www.cryptopp.com/wiki/Android_(Command_Line).
|
2015-06-08 11:50:22 +00:00
|
|
|
ifeq ($(IS_ANDROID),1)
|
2021-03-09 14:49:51 +00:00
|
|
|
# setenv-android.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
|
2021-02-05 11:09:19 +00:00
|
|
|
|
2017-09-13 11:16:41 +00:00
|
|
|
# Source files copied into PWD for Android cpu-features
|
|
|
|
# setenv-android.sh does the copying. Its a dirty compile.
|
2020-03-10 01:53:08 +00:00
|
|
|
ANDROID_CPU_OBJ = cpu-features.o
|
2015-06-08 11:50:22 +00:00
|
|
|
endif
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### Embedded #####
|
|
|
|
###########################################################
|
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
# ARM embedded cross-compile configuration.
|
2022-02-10 23:56:24 +00:00
|
|
|
# See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line)
|
|
|
|
# and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
|
2015-06-08 11:50:22 +00:00
|
|
|
ifeq ($(IS_ARM_EMBEDDED),1)
|
2021-03-09 14:49:51 +00:00
|
|
|
# setenv-android.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
|
2015-06-08 11:50:22 +00:00
|
|
|
endif
|
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
###########################################################
|
|
|
|
##### Compiler and Platform #####
|
|
|
|
###########################################################
|
|
|
|
|
2018-12-01 18:13:35 +00:00
|
|
|
# Wait until CXXFLAGS have been set by setenv scripts.
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2019-05-21 09:59:58 +00:00
|
|
|
GCC_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -v -E 'llvm|clang' | $(GREP) -i -c -E '(gcc|g\+\+)')
|
|
|
|
CLANG_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c -E 'llvm|clang')
|
2018-12-01 17:48:47 +00:00
|
|
|
|
|
|
|
HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
|
|
|
|
ifeq ($(HOSTX),)
|
|
|
|
HOSTX := $(shell uname -m 2>/dev/null)
|
|
|
|
endif
|
|
|
|
|
2018-12-01 18:13:35 +00:00
|
|
|
# This dance is because Clang reports the host architecture instead
|
2021-03-10 16:51:03 +00:00
|
|
|
# of the target architecture for -dumpmachine. Running Clang on an
|
|
|
|
# x86_64 machine with -arch arm64 yields x86_64 instead of arm64.
|
2018-12-01 18:13:35 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(CLANG_COMPILER),1)
|
2021-03-10 16:51:03 +00:00
|
|
|
# The compiler is either GCC or Clang
|
2019-05-21 09:59:58 +00:00
|
|
|
IS_X86 := $(shell echo $(CXXFLAGS) | $(GREP) -v 64 | $(GREP) -i -c -E 'i.86')
|
|
|
|
IS_X64 := $(shell echo $(CXXFLAGS) | $(GREP) -i -c -E 'x86_64|amd64')
|
2021-03-10 16:51:03 +00:00
|
|
|
IS_ARM32 := $(shell echo $(CXXFLAGS) | $(GREP) -v 64 | $(GREP) -i -c -E 'arm|armhf|arm7l|armeabihf')
|
2019-05-21 09:59:58 +00:00
|
|
|
IS_ARMV8 := $(shell echo $(CXXFLAGS) | $(GREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
|
2018-12-01 17:48:47 +00:00
|
|
|
else
|
2019-05-21 09:59:58 +00:00
|
|
|
IS_X86 := $(shell echo $(HOSTX) | $(GREP) -v 64 | $(GREP) -i -c -E 'i.86')
|
|
|
|
IS_X64 := $(shell echo $(HOSTX) | $(GREP) -i -c -E 'x86_64|amd64')
|
|
|
|
IS_ARM32 := $(shell echo $(HOSTX) | $(GREP) -v 64 | $(GREP) -i -c -E 'arm|armhf|arm7l|eabihf')
|
|
|
|
IS_ARMV8 := $(shell echo $(HOSTX) | $(GREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2019-10-16 11:42:48 +00:00
|
|
|
ifeq ($(IS_ARMV8),1)
|
|
|
|
IS_ARM32 = 0
|
|
|
|
endif
|
|
|
|
|
2019-10-18 21:00:17 +00:00
|
|
|
IS_PPC32 := 0
|
|
|
|
IS_PPC64 := 0
|
|
|
|
|
2021-03-09 20:06:19 +00:00
|
|
|
# Uncomment for debugging
|
|
|
|
# $(info Here's what we found... IS_X86: $(IS_X86), IS_X64: $(IS_X64), IS_ARM32: $(IS_ARM32), IS_ARMV8: $(IS_ARMV8))
|
2018-12-01 17:48:47 +00:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
##### Test Program #####
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
# Hack to skip CPU feature tests for some recipes
|
|
|
|
DETECT_FEATURES ?= 1
|
2022-02-11 03:45:43 +00:00
|
|
|
ifneq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CPPFLAGS)$(CXXFLAGS)h),)
|
2018-12-01 17:48:47 +00:00
|
|
|
DETECT_FEATURES := 0
|
2022-02-08 00:29:58 +00:00
|
|
|
else ifneq ($(findstring clean,$(MAKECMDGOALS)),)
|
2018-12-01 17:48:47 +00:00
|
|
|
DETECT_FEATURES := 0
|
2022-02-08 00:29:58 +00:00
|
|
|
else ifneq ($(findstring distclean,$(MAKECMDGOALS)),)
|
2018-12-01 17:48:47 +00:00
|
|
|
DETECT_FEATURES := 0
|
2022-02-08 00:29:58 +00:00
|
|
|
else ifneq ($(findstring trim,$(MAKECMDGOALS)),)
|
2018-12-01 17:48:47 +00:00
|
|
|
DETECT_FEATURES := 0
|
2022-02-08 00:29:58 +00:00
|
|
|
else ifneq ($(findstring zip,$(MAKECMDGOALS)),)
|
2020-03-10 01:53:08 +00:00
|
|
|
DETECT_FEATURES := 0
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2019-07-19 15:26:20 +00:00
|
|
|
# Strip out -Wall, -Wextra and friends for feature testing. FORTIFY_SOURCE is removed
|
|
|
|
# because it requires -O1 or higher, but we use -O0 to tame the optimizer.
|
2021-05-24 23:40:36 +00:00
|
|
|
# Always print testing flags since some tests always happen, like 64-bit.
|
|
|
|
TCXXFLAGS := $(filter-out -D_FORTIFY_SOURCE=% -M -MM -Wall -Wextra -Werror% -Wunused -Wconversion -Wp%, $(CPPFLAGS) $(CXXFLAGS))
|
|
|
|
ifneq ($(strip $(TCXXFLAGS)),)
|
|
|
|
$(info Using testing flags: $(TCXXFLAGS))
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-05-24 23:40:36 +00:00
|
|
|
# TCOMMAND is used for just about all tests. Make will lazy-evaluate
|
|
|
|
# the variables when executed by $(shell $(TCOMMAND) ...).
|
|
|
|
TCOMMAND = $(CXX) $(TCXXFLAGS) $(TEXTRA) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT)
|
2018-12-01 17:48:47 +00:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
##### X86/X32/X64 Options #####
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
ifneq ($(IS_X86)$(IS_X64),00)
|
|
|
|
ifeq ($(DETECT_FEATURES),1)
|
|
|
|
|
|
|
|
SSE2_FLAG = -msse2
|
|
|
|
SSE3_FLAG = -msse3
|
|
|
|
SSSE3_FLAG = -mssse3
|
|
|
|
SSE41_FLAG = -msse4.1
|
|
|
|
SSE42_FLAG = -msse4.2
|
|
|
|
CLMUL_FLAG = -mpclmul
|
|
|
|
AESNI_FLAG = -maes
|
|
|
|
AVX_FLAG = -mavx
|
|
|
|
AVX2_FLAG = -mavx2
|
|
|
|
SHANI_FLAG = -msha
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_x86_sse2.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(SSE2_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
CHACHA_FLAG = $(SSE2_FLAG)
|
|
|
|
else
|
2021-04-21 13:55:48 +00:00
|
|
|
# Make does not have useful debugging facilities. Show the user
|
|
|
|
# what happened by compiling again without the pipe.
|
|
|
|
$(info Running make again to see what failed)
|
2021-04-25 11:38:58 +00:00
|
|
|
$(info $(shell $(TCOMMAND)))
|
2018-12-01 17:48:47 +00:00
|
|
|
SSE2_FLAG =
|
|
|
|
endif
|
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(SSE2_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ASM
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-26 08:50:48 +00:00
|
|
|
# Need SSE2 or higher for these tests
|
2021-04-25 11:14:24 +00:00
|
|
|
ifneq ($(SSE2_FLAG),)
|
|
|
|
TPROG = TestPrograms/test_x86_ssse3.cpp
|
|
|
|
TOPT = $(SSSE3_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
ARIA_FLAG = $(SSSE3_FLAG)
|
|
|
|
CHAM_FLAG = $(SSSE3_FLAG)
|
|
|
|
KECCAK_FLAG = $(SSSE3_FLAG)
|
|
|
|
LEA_FLAG = $(SSSE3_FLAG)
|
2021-04-26 08:50:48 +00:00
|
|
|
LSH256_FLAG = $(SSSE3_FLAG)
|
|
|
|
LSH512_FLAG = $(SSSE3_FLAG)
|
2021-04-25 11:14:24 +00:00
|
|
|
SIMON128_FLAG = $(SSSE3_FLAG)
|
|
|
|
SPECK128_FLAG = $(SSSE3_FLAG)
|
|
|
|
else
|
|
|
|
SSSE3_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-26 08:50:48 +00:00
|
|
|
# The first Apple MacBooks were Core2's with SSE4.1
|
|
|
|
ifneq ($(IS_DARWIN),0)
|
|
|
|
# Add SSE2 algo's here as required
|
|
|
|
# They get a free upgrade
|
|
|
|
endif
|
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_sse41.cpp
|
|
|
|
TOPT = $(SSE41_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
BLAKE2B_FLAG = $(SSE41_FLAG)
|
|
|
|
BLAKE2S_FLAG = $(SSE41_FLAG)
|
|
|
|
else
|
|
|
|
SSE41_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_sse42.cpp
|
|
|
|
TOPT = $(SSE42_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
CRC_FLAG = $(SSE42_FLAG)
|
|
|
|
else
|
|
|
|
SSE42_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_clmul.cpp
|
|
|
|
TOPT = $(CLMUL_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
|
|
|
|
GF2N_FLAG = $(CLMUL_FLAG)
|
|
|
|
else
|
|
|
|
CLMUL_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_aes.cpp
|
|
|
|
TOPT = $(AESNI_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
AES_FLAG = $(SSE41_FLAG) $(AESNI_FLAG)
|
|
|
|
SM4_FLAG = $(SSSE3_FLAG) $(AESNI_FLAG)
|
|
|
|
else
|
|
|
|
AESNI_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_avx.cpp
|
|
|
|
TOPT = $(AVX_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
# XXX_FLAG = $(AVX_FLAG)
|
|
|
|
else
|
|
|
|
AVX_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_avx2.cpp
|
|
|
|
TOPT = $(AVX2_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
CHACHA_AVX2_FLAG = $(AVX2_FLAG)
|
2021-04-26 08:50:48 +00:00
|
|
|
LSH256_AVX2_FLAG = $(AVX2_FLAG)
|
|
|
|
LSH512_AVX2_FLAG = $(AVX2_FLAG)
|
2021-04-25 11:14:24 +00:00
|
|
|
else
|
|
|
|
AVX2_FLAG =
|
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
TPROG = TestPrograms/test_x86_sha.cpp
|
|
|
|
TOPT = $(SHANI_FLAG)
|
2021-04-25 11:38:58 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
SHA_FLAG = $(SSE42_FLAG) $(SHANI_FLAG)
|
|
|
|
else
|
|
|
|
SHANI_FLAG =
|
|
|
|
endif
|
2018-12-02 02:33:17 +00:00
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
ifeq ($(SSE3_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_SSE3
|
2021-04-25 11:14:24 +00:00
|
|
|
else ifeq ($(SSSE3_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_SSSE3
|
2021-04-25 11:14:24 +00:00
|
|
|
else ifeq ($(SSE41_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
2021-04-25 11:14:24 +00:00
|
|
|
else ifeq ($(SSE42_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_SSE4
|
2018-12-02 02:33:17 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
ifneq ($(SSE42_FLAG),)
|
|
|
|
# Unusual GCC/Clang on Macports. It assembles AES, but not CLMUL.
|
|
|
|
# test_x86_clmul.s:15: no such instruction: 'pclmulqdq $0, %xmm1,%xmm0'
|
|
|
|
ifeq ($(CLMUL_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_CLMUL
|
2021-04-25 11:14:24 +00:00
|
|
|
endif
|
|
|
|
ifeq ($(AESNI_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_AESNI
|
2021-04-25 11:14:24 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(AVX_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_AVX
|
2021-04-25 11:14:24 +00:00
|
|
|
else ifeq ($(AVX2_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_AVX2
|
2021-07-04 17:22:51 +00:00
|
|
|
endif
|
|
|
|
# SHANI independent of AVX per GH #1045
|
|
|
|
ifeq ($(SHANI_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_SHANI
|
2021-04-25 11:14:24 +00:00
|
|
|
endif
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
# Drop to SSE2 if available
|
|
|
|
ifeq ($(GCM_FLAG),)
|
2018-12-29 05:56:25 +00:00
|
|
|
GCM_FLAG = $(SSE2_FLAG)
|
|
|
|
endif
|
|
|
|
|
2021-04-25 11:14:24 +00:00
|
|
|
# Most Clang cannot handle mixed asm with positional arguments, where the
|
|
|
|
# body is Intel style with no prefix and the templates are AT&T style.
|
|
|
|
# Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
|
|
|
|
|
|
|
|
# CRYPTOPP_DISABLE_MIXED_ASM is now being added in config_asm.h for all
|
|
|
|
# Clang compilers. This test will need to be re-enabled if Clang fixes it.
|
|
|
|
#TPROG = TestPrograms/test_asm_mixed.cpp
|
2021-05-19 19:59:56 +00:00
|
|
|
#TOPT =
|
2021-04-26 08:50:48 +00:00
|
|
|
#HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2021-04-25 11:14:24 +00:00
|
|
|
#ifneq ($(strip $(HAVE_OPT)),0)
|
2022-02-08 00:29:58 +00:00
|
|
|
# CPPFLAGS += -DCRYPTOPP_DISABLE_MIXED_ASM
|
2021-04-25 11:14:24 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
# SSE2_FLAGS
|
|
|
|
endif
|
2019-10-15 22:05:54 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# DETECT_FEATURES
|
|
|
|
endif
|
|
|
|
|
2022-02-11 04:08:58 +00:00
|
|
|
# IS_X86 and IS_X64
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
2019-10-17 01:00:45 +00:00
|
|
|
##### ARM A-32 and NEON #####
|
2018-12-01 17:48:47 +00:00
|
|
|
###########################################################
|
|
|
|
|
2019-10-17 01:00:45 +00:00
|
|
|
ifneq ($(IS_ARM32),0)
|
2022-02-08 00:29:58 +00:00
|
|
|
|
|
|
|
# No need for feature detection on this platform if NEON is disabled
|
|
|
|
ifneq ($(findstring -DCRYPTOPP_DISABLE_ARM_NEON,$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
DETECT_FEATURES := 0
|
|
|
|
endif
|
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(DETECT_FEATURES),1)
|
|
|
|
|
2019-10-16 11:30:40 +00:00
|
|
|
# Android needs -c compile flag for NEON. Otherwise there's an odd linker message.
|
|
|
|
ifeq ($(IS_ANDROID),1)
|
2021-02-13 22:05:31 +00:00
|
|
|
NEON_FLAG = -march=armv7-a -mfpu=vfpv3-d16 -mfpu=neon
|
2018-12-01 17:48:47 +00:00
|
|
|
else
|
2021-02-13 22:05:31 +00:00
|
|
|
NEON_FLAG = -march=armv7-a -mfpu=neon
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2020-08-09 07:11:12 +00:00
|
|
|
# Clang needs an option to include <arm_neon.h>
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_neon_header.cpp
|
2021-05-25 01:17:07 +00:00
|
|
|
TOPT = -DCRYPTOPP_ARM_NEON_HEADER=1 $(NEON_FLAG)
|
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2020-08-07 07:22:34 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
2021-04-26 19:39:21 +00:00
|
|
|
TEXTRA += -DCRYPTOPP_ARM_NEON_HEADER=1
|
2020-08-07 07:22:34 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_neon.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(NEON_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
ARIA_FLAG = $(NEON_FLAG)
|
|
|
|
AES_FLAG = $(NEON_FLAG)
|
|
|
|
CRC_FLAG = $(NEON_FLAG)
|
|
|
|
GCM_FLAG = $(NEON_FLAG)
|
|
|
|
BLAKE2B_FLAG = $(NEON_FLAG)
|
|
|
|
BLAKE2S_FLAG = $(NEON_FLAG)
|
|
|
|
CHACHA_FLAG = $(NEON_FLAG)
|
|
|
|
CHAM_FLAG = $(NEON_FLAG)
|
|
|
|
LEA_FLAG = $(NEON_FLAG)
|
|
|
|
SHA_FLAG = $(NEON_FLAG)
|
|
|
|
SIMON128_FLAG = $(NEON_FLAG)
|
|
|
|
SPECK128_FLAG = $(NEON_FLAG)
|
|
|
|
SM4_FLAG = $(NEON_FLAG)
|
|
|
|
else
|
2021-04-21 13:55:48 +00:00
|
|
|
# Make does not have useful debugging facilities. Show the user
|
|
|
|
# what happened by compiling again without the pipe.
|
2022-02-11 00:39:44 +00:00
|
|
|
#$(info Running make again to see what failed)
|
|
|
|
#$(info $(shell $(TCOMMAND)))
|
2018-12-01 17:48:47 +00:00
|
|
|
NEON_FLAG =
|
2021-04-21 13:55:48 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NEON_FLAG),)
|
2022-02-11 00:39:44 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_NEON
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2019-10-17 01:00:45 +00:00
|
|
|
# DETECT_FEATURES
|
|
|
|
endif
|
2019-02-28 11:42:16 +00:00
|
|
|
# IS_ARM32
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2019-10-17 01:00:45 +00:00
|
|
|
###########################################################
|
|
|
|
##### Aach32 and Aarch64 #####
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
ifneq ($(IS_ARMV8),0)
|
|
|
|
ifeq ($(DETECT_FEATURES),1)
|
2018-12-01 17:48:47 +00:00
|
|
|
|
|
|
|
ifeq ($(IS_IOS),1)
|
2021-05-26 00:24:58 +00:00
|
|
|
ASIMD_FLAG = -arch arm64
|
|
|
|
CRC_FLAG = -arch arm64
|
|
|
|
AES_FLAG = -arch arm64
|
|
|
|
PMUL_FLAG = -arch arm64
|
|
|
|
SHA_FLAG = -arch arm64
|
2018-12-01 17:48:47 +00:00
|
|
|
else
|
2018-12-04 10:49:21 +00:00
|
|
|
ASIMD_FLAG = -march=armv8-a
|
|
|
|
CRC_FLAG = -march=armv8-a+crc
|
|
|
|
AES_FLAG = -march=armv8-a+crypto
|
2020-07-28 18:09:17 +00:00
|
|
|
GCM_FLAG = -march=armv8-a+crypto
|
|
|
|
GF2N_FLAG = -march=armv8-a+crypto
|
2018-12-04 10:49:21 +00:00
|
|
|
SHA_FLAG = -march=armv8-a+crypto
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_neon_header.cpp
|
2021-05-25 01:17:07 +00:00
|
|
|
TOPT = -DCRYPTOPP_ARM_NEON_HEADER=1
|
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2020-07-29 18:07:13 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
2021-04-26 19:39:21 +00:00
|
|
|
TEXTRA += -DCRYPTOPP_ARM_NEON_HEADER=1
|
2020-07-29 18:07:13 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_acle_header.cpp
|
2021-05-25 01:17:07 +00:00
|
|
|
TOPT = -DCRYPTOPP_ARM_ACLE_HEADER=1 $(ASIMD_FLAG)
|
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
2021-04-26 19:39:21 +00:00
|
|
|
TEXTRA += -DCRYPTOPP_ARM_ACLE_HEADER=1
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_asimd.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(ASIMD_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
ARIA_FLAG = $(ASIMD_FLAG)
|
|
|
|
BLAKE2B_FLAG = $(ASIMD_FLAG)
|
|
|
|
BLAKE2S_FLAG = $(ASIMD_FLAG)
|
|
|
|
CHACHA_FLAG = $(ASIMD_FLAG)
|
|
|
|
CHAM_FLAG = $(ASIMD_FLAG)
|
|
|
|
LEA_FLAG = $(ASIMD_FLAG)
|
|
|
|
NEON_FLAG = $(ASIMD_FLAG)
|
|
|
|
SIMON128_FLAG = $(ASIMD_FLAG)
|
|
|
|
SPECK128_FLAG = $(ASIMD_FLAG)
|
|
|
|
SM4_FLAG = $(ASIMD_FLAG)
|
|
|
|
else
|
2021-04-21 13:55:48 +00:00
|
|
|
# Make does not have useful debugging facilities. Show the user
|
|
|
|
# what happened by compiling again without the pipe.
|
|
|
|
$(info Running make again to see what failed)
|
2021-04-25 11:38:58 +00:00
|
|
|
$(info $(shell $(TCOMMAND)))
|
2018-12-01 17:48:47 +00:00
|
|
|
ASIMD_FLAG =
|
2021-04-21 13:55:48 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(ASIMD_FLAG),)
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ASM
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-25 11:38:58 +00:00
|
|
|
ifneq ($(ASIMD_FLAG),)
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_crc.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(CRC_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifneq ($(strip $(HAVE_OPT)),0)
|
|
|
|
CRC_FLAG =
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_CRC32
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_aes.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(AES_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifneq ($(strip $(HAVE_OPT)),0)
|
|
|
|
AES_FLAG =
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_AES
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_pmull.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(PMULL_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2020-07-29 16:21:42 +00:00
|
|
|
ifneq ($(strip $(HAVE_OPT)),0)
|
2020-07-28 18:09:17 +00:00
|
|
|
GCM_FLAG =
|
|
|
|
GF2N_FLAG =
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_PMULL
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_sha1.cpp
|
2018-12-01 17:48:47 +00:00
|
|
|
TOPT = $(SHA_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifneq ($(strip $(HAVE_OPT)),0)
|
|
|
|
SHA_FLAG =
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA1
|
2020-07-29 18:07:13 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_sha256.cpp
|
2020-07-29 18:07:13 +00:00
|
|
|
TOPT = $(SHA_FLAG)
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2020-07-29 18:07:13 +00:00
|
|
|
ifneq ($(strip $(HAVE_OPT)),0)
|
|
|
|
SHA_FLAG =
|
2022-02-08 00:29:58 +00:00
|
|
|
CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA2
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_sm3.cpp
|
2021-05-23 08:09:27 +00:00
|
|
|
TOPT = -march=armv8.4-a+sm3
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
2021-05-23 08:09:27 +00:00
|
|
|
SM3_FLAG = -march=armv8.4-a+sm3
|
|
|
|
SM4_FLAG = -march=armv8.4-a+sm3
|
2020-07-29 18:07:13 +00:00
|
|
|
else
|
2022-02-08 00:29:58 +00:00
|
|
|
#CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SM3
|
|
|
|
#CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SM4
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-20 08:44:21 +00:00
|
|
|
TPROG = TestPrograms/test_arm_sha3.cpp
|
2021-05-23 08:09:27 +00:00
|
|
|
TOPT = -march=armv8.4-a+sha3
|
2021-04-26 09:37:17 +00:00
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
2018-12-01 17:48:47 +00:00
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
2021-05-23 08:09:27 +00:00
|
|
|
SHA3_FLAG = -march=armv8.4-a+sha3
|
2020-07-29 18:07:13 +00:00
|
|
|
else
|
2022-02-08 00:29:58 +00:00
|
|
|
#CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA3
|
2021-05-23 08:09:27 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
TPROG = TestPrograms/test_arm_sha512.cpp
|
|
|
|
TOPT = -march=armv8.4-a+sha512
|
|
|
|
HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
|
|
|
|
ifeq ($(strip $(HAVE_OPT)),0)
|
|
|
|
SHA512_FLAG = -march=armv8.4-a+sha512
|
|
|
|
else
|
2022-02-08 00:29:58 +00:00
|
|
|
#CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA512
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2021-04-25 11:38:58 +00:00
|
|
|
# ASIMD_FLAG
|
|
|
|
endif
|
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# DETECT_FEATURES
|
|
|
|
endif
|
2019-10-17 01:00:45 +00:00
|
|
|
# IS_ARMV8
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### Common #####
|
|
|
|
###########################################################
|
|
|
|
|
2017-05-27 02:20:38 +00:00
|
|
|
# Undefined Behavior Sanitizer (UBsan) testing. Issue 'make ubsan'.
|
|
|
|
ifeq ($(findstring ubsan,$(MAKECMDGOALS)),ubsan)
|
|
|
|
ifeq ($(findstring -fsanitize=undefined,$(CXXFLAGS)),)
|
|
|
|
CXXFLAGS += -fsanitize=undefined
|
|
|
|
endif # CXXFLAGS
|
2022-02-08 00:29:58 +00:00
|
|
|
ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
CPPFLAGS += -DCRYPTOPP_COVERAGE
|
|
|
|
endif # CPPFLAGS
|
2017-05-27 02:20:38 +00:00
|
|
|
endif # UBsan
|
|
|
|
|
|
|
|
# Address Sanitizer (Asan) testing. Issue 'make asan'.
|
|
|
|
ifeq ($(findstring asan,$(MAKECMDGOALS)),asan)
|
|
|
|
ifeq ($(findstring -fsanitize=address,$(CXXFLAGS)),)
|
|
|
|
CXXFLAGS += -fsanitize=address
|
|
|
|
endif # CXXFLAGS
|
2022-02-08 00:29:58 +00:00
|
|
|
ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
CPPFLAGS += -DCRYPTOPP_COVERAGE
|
|
|
|
endif # CPPFLAGS
|
2017-05-27 02:20:38 +00:00
|
|
|
ifeq ($(findstring -fno-omit-frame-pointer,$(CXXFLAGS)),)
|
|
|
|
CXXFLAGS += -fno-omit-frame-pointer
|
|
|
|
endif # CXXFLAGS
|
|
|
|
endif # Asan
|
|
|
|
|
|
|
|
# LD gold linker testing. Triggered by 'LD=ld.gold'.
|
|
|
|
ifeq ($(findstring ld.gold,$(LD)),ld.gold)
|
|
|
|
ifeq ($(findstring -fuse-ld=gold,$(CXXFLAGS)),)
|
2019-05-21 09:59:58 +00:00
|
|
|
ELF_FORMAT := $(shell file `which ld.gold` 2>&1 | cut -d":" -f 2 | $(GREP) -i -c "elf")
|
2017-05-27 02:20:38 +00:00
|
|
|
ifneq ($(ELF_FORMAT),0)
|
|
|
|
LDFLAGS += -fuse-ld=gold
|
|
|
|
endif # ELF/ELF64
|
|
|
|
endif # CXXFLAGS
|
|
|
|
endif # Gold
|
|
|
|
|
|
|
|
# Valgrind testing. Issue 'make valgrind'.
|
|
|
|
ifneq ($(filter valgrind,$(MAKECMDGOALS)),)
|
|
|
|
# Tune flags; see http://valgrind.org/docs/manual/quick-start.html
|
|
|
|
CXXFLAGS := $(CXXFLAGS:-g%=-g3)
|
|
|
|
CXXFLAGS := $(CXXFLAGS:-O%=-O1)
|
|
|
|
CXXFLAGS := $(CXXFLAGS:-xO%=-xO1)
|
2022-02-08 00:29:58 +00:00
|
|
|
ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
CPPFLAGS += -DCRYPTOPP_COVERAGE
|
|
|
|
endif # CPPFLAGS
|
2017-05-27 02:20:38 +00:00
|
|
|
endif # Valgrind
|
|
|
|
|
|
|
|
# Debug testing on GNU systems. Triggered by -DDEBUG.
|
2022-02-08 00:29:58 +00:00
|
|
|
# Newlib test due to http://sourceware.org/bugzilla/show_bug.cgi?id=20268
|
|
|
|
ifneq ($(filter -DDEBUG -DDEBUG=1,$(CPPFLAGS) $(CXXFLAGS)),)
|
|
|
|
USING_GLIBCXX := $(shell $(CXX) $(CPPFLAGS) $(CXXFLAGS) -E pch.cpp 2>&1 | $(GREP) -i -c "__GLIBCXX__")
|
2017-05-27 02:20:38 +00:00
|
|
|
ifneq ($(USING_GLIBCXX),0)
|
|
|
|
ifeq ($(HAS_NEWLIB),0)
|
2022-02-08 00:29:58 +00:00
|
|
|
ifeq ($(findstring -D_GLIBCXX_DEBUG,$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
CPPFLAGS += -D_GLIBCXX_DEBUG
|
|
|
|
endif # CPPFLAGS
|
2017-05-27 02:20:38 +00:00
|
|
|
endif # HAS_NEWLIB
|
|
|
|
endif # USING_GLIBCXX
|
|
|
|
endif # GNU Debug build
|
|
|
|
|
2016-01-05 01:23:19 +00:00
|
|
|
# Dead code stripping. Issue 'make lean'.
|
|
|
|
ifeq ($(findstring lean,$(MAKECMDGOALS)),lean)
|
|
|
|
ifeq ($(findstring -ffunction-sections,$(CXXFLAGS)),)
|
|
|
|
CXXFLAGS += -ffunction-sections
|
|
|
|
endif # CXXFLAGS
|
|
|
|
ifeq ($(findstring -fdata-sections,$(CXXFLAGS)),)
|
|
|
|
CXXFLAGS += -fdata-sections
|
|
|
|
endif # CXXFLAGS
|
2017-05-27 02:23:35 +00:00
|
|
|
ifneq ($(IS_IOS),0)
|
2016-01-05 01:23:19 +00:00
|
|
|
ifeq ($(findstring -Wl,-dead_strip,$(LDFLAGS)),)
|
|
|
|
LDFLAGS += -Wl,-dead_strip
|
|
|
|
endif # CXXFLAGS
|
|
|
|
else # BSD, Linux and Unix
|
|
|
|
ifeq ($(findstring -Wl,--gc-sections,$(LDFLAGS)),)
|
|
|
|
LDFLAGS += -Wl,--gc-sections
|
|
|
|
endif # LDFLAGS
|
|
|
|
endif # MAKECMDGOALS
|
|
|
|
endif # Dead code stripping
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### Source and object files #####
|
|
|
|
###########################################################
|
|
|
|
|
2016-11-05 01:20:45 +00:00
|
|
|
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
|
2019-10-23 22:36:05 +00:00
|
|
|
SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp,$(sort $(wildcard *.cpp)))
|
2017-11-01 22:25:44 +00:00
|
|
|
# For Makefile.am; resource.h is Windows
|
|
|
|
INCL := $(filter-out resource.h,$(sort $(wildcard *.h)))
|
|
|
|
|
2022-02-08 17:33:13 +00:00
|
|
|
# Cryptogams source files. We couple to ARMv7 and NEON.
|
2019-05-21 09:59:58 +00:00
|
|
|
# Limit to Linux. The source files target the GNU assembler.
|
2019-05-23 23:35:05 +00:00
|
|
|
# Also see https://www.cryptopp.com/wiki/Cryptogams.
|
2019-05-21 09:59:58 +00:00
|
|
|
ifeq ($(IS_ARM32)$(IS_LINUX),11)
|
2022-02-11 03:45:43 +00:00
|
|
|
ifeq ($(filter -DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_ARM_NEON,$(CPPFLAGS)$(CXXFLAGS)),)
|
2022-02-10 23:56:24 +00:00
|
|
|
# Do not use -march=armv7 if the compiler is already targeting the ISA.
|
|
|
|
# Also see https://github.com/weidai11/cryptopp/issues/1094
|
2022-02-13 07:13:16 +00:00
|
|
|
ifeq ($(shell $(CXX) -dM -E TestPrograms/test_cxx.cpp 2>/dev/null | grep -E '__ARM_ARCH 7|__ARM_ARCH_7A__'),)
|
2022-02-10 23:56:24 +00:00
|
|
|
CRYPTOGAMS_ARMV7_FLAG = -march=armv7-a
|
|
|
|
endif
|
2022-02-08 17:33:13 +00:00
|
|
|
ifeq ($(CLANG_COMPILER),1)
|
2022-02-10 23:56:24 +00:00
|
|
|
CRYPTOGAMS_ARM_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
|
|
|
|
CRYPTOGAMS_ARM_THUMB_FLAG = $(CRYPTOGAMS_ARMV7_FLAG) -mthumb
|
2022-02-08 17:33:13 +00:00
|
|
|
else
|
2022-02-10 23:56:24 +00:00
|
|
|
# -mfpu=auto due to https://github.com/weidai11/cryptopp/issues/1094
|
|
|
|
CRYPTOGAMS_ARM_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
|
|
|
|
CRYPTOGAMS_ARM_THUMB_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
|
2022-02-08 17:33:13 +00:00
|
|
|
endif
|
|
|
|
SRCS += aes_armv4.S sha1_armv4.S sha256_armv4.S sha512_armv4.S
|
2018-12-01 17:48:47 +00:00
|
|
|
endif
|
Add ARMv8.4 cpu feature detection support (GH #685) (#687)
This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are available.
We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1.
ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future.
Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
2018-07-15 12:35:14 +00:00
|
|
|
endif
|
|
|
|
|
2019-10-19 08:21:05 +00:00
|
|
|
# Remove unneeded arch specific files to speed build time.
|
2019-10-18 21:00:17 +00:00
|
|
|
ifeq ($(IS_PPC32)$(IS_PPC64),00)
|
|
|
|
SRCS := $(filter-out ppc_%,$(SRCS))
|
|
|
|
endif
|
|
|
|
ifeq ($(IS_ARM32)$(IS_ARMV8),00)
|
|
|
|
SRCS := $(filter-out arm_%,$(SRCS))
|
2019-10-19 08:21:05 +00:00
|
|
|
SRCS := $(filter-out neon_%,$(SRCS))
|
2019-10-18 21:00:17 +00:00
|
|
|
endif
|
2022-02-11 04:08:58 +00:00
|
|
|
ifeq ($(IS_X86)$(IS_X64),00)
|
2019-10-18 21:00:17 +00:00
|
|
|
SRCS := $(filter-out sse_%,$(SRCS))
|
2022-02-11 04:08:58 +00:00
|
|
|
SRCS := $(filter-out %_sse.cpp,$(SRCS))
|
|
|
|
SRCS := $(filter-out %_avx.cpp,$(SRCS))
|
2019-10-18 21:00:17 +00:00
|
|
|
endif
|
|
|
|
|
2022-02-16 02:33:38 +00:00
|
|
|
# If ASM is disabled we can remove the SIMD files, too.
|
|
|
|
ifneq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CRYPTOPP_CPPFLAGS)$(CPPFLAGS)$(CXXFLAGS)),)
|
|
|
|
SRCS := $(filter-out arm_%,$(SRCS))
|
|
|
|
SRCS := $(filter-out ppc_%,$(SRCS))
|
|
|
|
SRCS := $(filter-out neon_%,$(SRCS))
|
|
|
|
SRCS := $(filter-out sse_%,$(SRCS))
|
|
|
|
SRCS := $(filter-out %_sse.cpp,$(SRCS))
|
|
|
|
SRCS := $(filter-out %_avx.cpp,$(SRCS))
|
|
|
|
SRCS := $(filter-out %_simd.cpp,$(SRCS))
|
|
|
|
endif
|
|
|
|
|
2016-11-05 01:20:45 +00:00
|
|
|
# List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
|
2015-11-05 06:59:46 +00:00
|
|
|
OBJS := $(SRCS:.cpp=.o)
|
Add ARMv8.4 cpu feature detection support (GH #685) (#687)
This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are available.
We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1.
ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future.
Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
2018-07-15 12:35:14 +00:00
|
|
|
OBJS := $(OBJS:.S=.o)
|
2015-07-31 18:24:49 +00:00
|
|
|
|
2016-11-05 01:20:45 +00:00
|
|
|
# List test.cpp first to tame C++ static initialization problems.
|
2018-07-30 00:30:19 +00:00
|
|
|
TESTSRCS := adhoc.cpp test.cpp bench1.cpp bench2.cpp bench3.cpp datatest.cpp dlltest.cpp fipsalgt.cpp validat0.cpp validat1.cpp validat2.cpp validat3.cpp validat4.cpp validat5.cpp validat6.cpp validat7.cpp validat8.cpp validat9.cpp validat10.cpp regtest1.cpp regtest2.cpp regtest3.cpp regtest4.cpp
|
2017-11-01 22:25:44 +00:00
|
|
|
TESTINCL := bench.h factory.h validate.h
|
Add ARMv8.4 cpu feature detection support (GH #685) (#687)
This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are available.
We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1.
ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future.
Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
2018-07-15 12:35:14 +00:00
|
|
|
|
|
|
|
# Test objects
|
2015-12-08 19:55:58 +00:00
|
|
|
TESTOBJS := $(TESTSRCS:.cpp=.o)
|
2015-11-05 06:59:46 +00:00
|
|
|
LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2021-01-01 16:46:42 +00:00
|
|
|
# Clean recipe, Issue 998. Don't filter-out some artifacts from the list of objects
|
2021-02-03 00:41:27 +00:00
|
|
|
# The *.S is a hack. It makes the ASM appear like C++ so the object files make the CLEAN_OBJS list
|
2021-01-01 17:22:59 +00:00
|
|
|
CLEAN_SRCS := $(wildcard *.cpp) $(patsubst %.S,%.cpp,$(wildcard *.S))
|
2021-01-01 16:46:42 +00:00
|
|
|
CLEAN_OBJS := $(CLEAN_SRCS:.cpp=.o) $(CLEAN_SRCS:.cpp=.import.o) $(CLEAN_SRCS:.cpp=.export.o)
|
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
# For Shared Objects, Diff, Dist/Zip rules
|
2019-05-21 09:59:58 +00:00
|
|
|
LIB_VER := $(shell $(GREP) "define CRYPTOPP_VERSION" config_ver.h | cut -d" " -f 3)
|
2015-12-08 19:55:58 +00:00
|
|
|
LIB_MAJOR := $(shell echo $(LIB_VER) | cut -c 1)
|
|
|
|
LIB_MINOR := $(shell echo $(LIB_VER) | cut -c 2)
|
|
|
|
LIB_PATCH := $(shell echo $(LIB_VER) | cut -c 3)
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
ifeq ($(strip $(LIB_PATCH)),)
|
|
|
|
LIB_PATCH := 0
|
|
|
|
endif
|
2015-07-31 18:24:49 +00:00
|
|
|
|
2015-12-26 18:57:04 +00:00
|
|
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
|
|
|
# Full version suffix for shared library
|
|
|
|
SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
|
2018-02-20 15:05:52 +00:00
|
|
|
# Different patchlevels and minors are compatible since 6.1
|
|
|
|
SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR)
|
2015-12-26 18:57:04 +00:00
|
|
|
SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
|
|
|
endif # HAS_SOLIB_VERSION
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
###########################################################
|
|
|
|
##### Targets and Recipes #####
|
|
|
|
###########################################################
|
|
|
|
|
2018-01-27 18:05:23 +00:00
|
|
|
# Default builds program with static library only
|
|
|
|
.PHONY: default
|
|
|
|
default: cryptest.exe
|
|
|
|
|
2018-07-31 17:33:57 +00:00
|
|
|
.PHONY: all static dynamic
|
2018-01-27 18:05:23 +00:00
|
|
|
all: static dynamic cryptest.exe
|
2015-07-31 18:24:49 +00:00
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
ifneq ($(IS_IOS),0)
|
2015-11-05 06:59:46 +00:00
|
|
|
static: libcryptopp.a
|
|
|
|
shared dynamic dylib: libcryptopp.dylib
|
|
|
|
else
|
2015-06-08 11:50:22 +00:00
|
|
|
static: libcryptopp.a
|
2015-12-26 18:57:04 +00:00
|
|
|
shared dynamic: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
2015-11-05 06:59:46 +00:00
|
|
|
endif
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2018-01-27 18:05:23 +00:00
|
|
|
.PHONY: test check
|
|
|
|
test check: cryptest.exe
|
2015-06-08 11:50:22 +00:00
|
|
|
./cryptest.exe v
|
|
|
|
|
2016-01-05 01:23:19 +00:00
|
|
|
# CXXFLAGS are tuned earlier. Applications must use linker flags
|
|
|
|
# -Wl,--gc-sections (Linux and Unix) or -Wl,-dead_strip (OS X)
|
|
|
|
.PHONY: lean
|
|
|
|
lean: static dynamic cryptest.exe
|
|
|
|
|
2015-07-31 18:24:49 +00:00
|
|
|
.PHONY: clean
|
2015-06-08 11:50:22 +00:00
|
|
|
clean:
|
2021-01-01 16:46:42 +00:00
|
|
|
-$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(CLEAN_OBJS) $(ANDROID_CPU_OBJ) rdrand-*.o
|
2017-03-09 09:01:36 +00:00
|
|
|
@-$(RM) libcryptopp.a libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a
|
|
|
|
@-$(RM) libcryptopp.so libcryptopp.so$(SOLIB_COMPAT_SUFFIX) libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
2021-03-19 05:15:14 +00:00
|
|
|
@-$(RM) cryptest.exe dlltest.exe cryptest.import.exe cryptest.dat ct et
|
2017-11-05 08:42:39 +00:00
|
|
|
@-$(RM) *.la *.lo *.gcov *.gcno *.gcda *.stackdump core core-*
|
2017-03-09 09:01:36 +00:00
|
|
|
@-$(RM) /tmp/adhoc.exe
|
|
|
|
@-$(RM) -r /tmp/cryptopp_test/
|
|
|
|
@-$(RM) -r *.exe.dSYM/
|
|
|
|
@-$(RM) -r *.dylib.dSYM/
|
|
|
|
@-$(RM) -r cov-int/
|
2015-11-05 06:59:46 +00:00
|
|
|
|
2018-07-28 13:21:31 +00:00
|
|
|
.PHONY: autotools-clean
|
|
|
|
autotools-clean:
|
2022-02-13 02:25:08 +00:00
|
|
|
@-$(RM) -f bootstrap.sh configure.ac configure configure.in Makefile.am Makefile.in Makefile
|
2018-07-28 16:38:15 +00:00
|
|
|
@-$(RM) -f config.guess config.status config.sub config.h.in compile depcomp
|
|
|
|
@-$(RM) -f install-sh stamp-h1 ar-lib *.lo *.la *.m4 local.* lt*.sh missing
|
|
|
|
@-$(RM) -f cryptest cryptestcwd libtool* libcryptopp.la libcryptopp.pc*
|
2020-07-11 07:03:19 +00:00
|
|
|
@-$(RM) -rf build-aux/ m4/ auto*.cache/ .deps/ .libs/
|
2018-07-28 13:21:31 +00:00
|
|
|
|
|
|
|
.PHONY: cmake-clean
|
|
|
|
cmake-clean:
|
|
|
|
@-$(RM) -f cryptopp-config.cmake CMakeLists.txt
|
|
|
|
@-$(RM) -rf cmake_build/
|
|
|
|
|
2019-10-18 05:08:59 +00:00
|
|
|
.PHONY: android-clean
|
|
|
|
android-clean:
|
|
|
|
@-$(RM) -f $(patsubst %_simd.cpp,%_simd.cpp.neon,$(wildcard *_simd.cpp))
|
|
|
|
@-$(RM) -rf obj/
|
|
|
|
|
2018-07-28 13:21:31 +00:00
|
|
|
.PHONY: distclean
|
2019-10-18 05:08:59 +00:00
|
|
|
distclean: clean autotools-clean cmake-clean android-clean
|
2021-03-19 05:48:16 +00:00
|
|
|
-$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt
|
2021-03-20 04:43:03 +00:00
|
|
|
-$(RM) cryptest_all.info cryptest_debug.info cryptest_noasm.info cryptest_base.info cryptest.info cryptest_release.info
|
2018-07-28 13:31:41 +00:00
|
|
|
@-$(RM) cryptest-*.txt cryptopp.tgz libcryptopp.pc *.o *.bc *.ii *~
|
2018-07-28 13:21:31 +00:00
|
|
|
@-$(RM) -r cryptlib.lib cryptest.exe *.suo *.sdf *.pdb Win32/ x64/ ipch/
|
2018-08-02 01:33:24 +00:00
|
|
|
@-$(RM) -r $(LIBOBJS:.o=.obj) $(TESTOBJS:.o=.obj)
|
2018-08-05 00:18:50 +00:00
|
|
|
@-$(RM) -r $(LIBOBJS:.o=.lst) $(TESTOBJS:.o=.lst)
|
|
|
|
@-$(RM) -r TestCoverage/ ref*/
|
2018-07-28 13:21:31 +00:00
|
|
|
@-$(RM) cryptopp$(LIB_VER)\.* CryptoPPRef.zip
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2018-05-06 04:10:38 +00:00
|
|
|
# Install cryptest.exe, libcryptopp.a and libcryptopp.so.
|
|
|
|
# The library install was broken-out into its own recipe at GH #653.
|
2015-07-31 18:24:49 +00:00
|
|
|
.PHONY: install
|
2018-05-06 04:10:38 +00:00
|
|
|
install: cryptest.exe install-lib
|
2018-02-05 13:54:13 +00:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(BINDIR)
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) cryptest.exe $(DESTDIR)$(BINDIR)
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rwx,go=rx $(DESTDIR)$(BINDIR)/cryptest.exe
|
2018-02-05 13:54:13 +00:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData
|
|
|
|
@-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rw,go=r $(DESTDIR)$(DATADIR)/cryptopp/TestData/*.dat
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rw,go=r $(DESTDIR)$(DATADIR)/cryptopp/TestVectors/*.txt
|
2018-05-06 04:10:38 +00:00
|
|
|
|
|
|
|
# A recipe to install only the library, and not cryptest.exe. Also
|
|
|
|
# see https://github.com/weidai11/cryptopp/issues/653.
|
|
|
|
.PHONY: install-lib
|
|
|
|
install-lib:
|
|
|
|
@-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rw,go=r $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
|
2015-12-27 18:13:16 +00:00
|
|
|
ifneq ($(wildcard libcryptopp.a),)
|
2018-02-05 13:54:13 +00:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rw,go=r $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
2015-12-27 18:13:16 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(wildcard libcryptopp.dylib),)
|
2018-02-05 13:54:13 +00:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rwx,go=rx $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
2019-01-03 00:48:20 +00:00
|
|
|
-install_name_tool -id $(DESTDIR)$(LIBDIR)/libcryptopp.dylib $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
2015-12-27 18:13:16 +00:00
|
|
|
endif
|
|
|
|
ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
|
2018-02-05 13:54:13 +00:00
|
|
|
@-$(MKDIR) $(DESTDIR)$(LIBDIR)
|
2019-01-03 00:48:20 +00:00
|
|
|
$(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rwx,go=rx $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
2015-12-26 18:57:04 +00:00
|
|
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
2017-12-16 14:07:23 +00:00
|
|
|
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
2022-01-07 23:26:53 +00:00
|
|
|
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
2017-12-16 14:07:23 +00:00
|
|
|
$(LDCONF) $(DESTDIR)$(LIBDIR)
|
2015-12-26 18:57:04 +00:00
|
|
|
endif
|
2015-11-05 06:59:46 +00:00
|
|
|
endif
|
2019-01-03 00:48:20 +00:00
|
|
|
ifneq ($(wildcard libcryptopp.pc),)
|
|
|
|
@-$(MKDIR) $(DESTDIR)$(LIBDIR)/pkgconfig
|
|
|
|
$(CP) libcryptopp.pc $(DESTDIR)$(LIBDIR)/pkgconfig
|
2021-02-14 20:34:36 +00:00
|
|
|
$(CHMOD) u=rw,go=r $(DESTDIR)$(LIBDIR)/pkgconfig/libcryptopp.pc
|
2019-01-03 00:48:20 +00:00
|
|
|
endif
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2015-11-05 06:59:46 +00:00
|
|
|
.PHONY: remove uninstall
|
|
|
|
remove uninstall:
|
2015-12-31 06:43:42 +00:00
|
|
|
-$(RM) -r $(DESTDIR)$(INCLUDEDIR)/cryptopp
|
|
|
|
-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.a
|
|
|
|
-$(RM) $(DESTDIR)$(BINDIR)/cryptest.exe
|
2017-03-09 09:01:36 +00:00
|
|
|
@-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
|
|
|
|
@-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
|
|
|
@-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
|
|
|
@-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2020-03-10 01:53:08 +00:00
|
|
|
libcryptopp.a: $(LIBOBJS) $(ANDROID_CPU_OBJ)
|
|
|
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS) $(ANDROID_CPU_OBJ)
|
2015-06-08 11:50:22 +00:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
2015-12-31 21:05:14 +00:00
|
|
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
2015-12-26 18:57:04 +00:00
|
|
|
.PHONY: libcryptopp.so
|
2015-12-27 18:13:16 +00:00
|
|
|
libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
|
2015-12-31 21:05:14 +00:00
|
|
|
endif
|
2015-12-26 18:57:04 +00:00
|
|
|
|
2020-03-10 01:53:08 +00:00
|
|
|
libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS) $(ANDROID_CPU_OBJ)
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) -shared $(SOLIB_FLAGS) -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) -Wl,--exclude-libs,ALL $(LIBOBJS) $(ANDROID_CPU_OBJ) $(LDFLAGS) $(LDLIBS)
|
2015-12-26 18:57:04 +00:00
|
|
|
ifeq ($(HAS_SOLIB_VERSION),1)
|
|
|
|
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
|
|
|
|
-$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
|
|
|
|
endif
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2020-03-10 01:53:08 +00:00
|
|
|
libcryptopp.dylib: $(LIBOBJS)
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) -dynamiclib -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
|
2015-12-08 19:55:58 +00:00
|
|
|
|
2019-07-21 06:24:06 +00:00
|
|
|
cryptest.exe: $(LINK_LIBRARY) $(TESTOBJS)
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) $(TESTOBJS) $(LINK_LIBRARY_PATH)$(LINK_LIBRARY) $(LDFLAGS) $(LDLIBS)
|
2015-06-08 11:50:22 +00:00
|
|
|
|
2015-12-08 19:55:58 +00:00
|
|
|
# Used to generate list of source files for Autotools, CMakeList and Android.mk
|
|
|
|
.PHONY: sources
|
|
|
|
sources:
|
2018-07-25 04:11:09 +00:00
|
|
|
$(info ***** Library sources *****)
|
|
|
|
$(info $(filter-out $(TESTSRCS),$(SRCS)))
|
2015-12-08 19:55:58 +00:00
|
|
|
$(info )
|
2018-07-25 04:11:09 +00:00
|
|
|
$(info ***** Library headers *****)
|
|
|
|
$(info $(filter-out $(TESTINCL),$(INCL)))
|
2017-11-01 22:25:44 +00:00
|
|
|
$(info )
|
2018-07-25 04:11:09 +00:00
|
|
|
$(info ***** Test sources *****)
|
|
|
|
$(info $(TESTSRCS))
|
2017-11-01 22:25:44 +00:00
|
|
|
$(info )
|
2018-07-25 04:11:09 +00:00
|
|
|
$(info ***** Test headers *****)
|
|
|
|
$(info $(TESTINCL))
|
2015-12-08 19:55:58 +00:00
|
|
|
|
2015-06-08 11:50:22 +00:00
|
|
|
adhoc.cpp: adhoc.cpp.proto
|
|
|
|
ifeq ($(wildcard adhoc.cpp),)
|
|
|
|
cp adhoc.cpp.proto adhoc.cpp
|
|
|
|
else
|
|
|
|
touch adhoc.cpp
|
|
|
|
endif
|
|
|
|
|
2015-11-18 20:35:35 +00:00
|
|
|
# Include dependencies, if present. You must issue `make deps` to create them.
|
|
|
|
ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps)
|
|
|
|
-include GNUmakefile.deps
|
|
|
|
endif # Dependencies
|
|
|
|
|
2021-02-14 19:49:27 +00:00
|
|
|
# A few recipes trigger warnings for -std=c++11 and -stdlib=c++
|
|
|
|
NOSTD_CXXFLAGS=$(filter-out -stdlib=%,$(filter-out -std=%,$(CXXFLAGS)))
|
|
|
|
|
2019-05-21 08:23:40 +00:00
|
|
|
# Cryptogams ARM asm implementation. AES needs -mthumb for Clang
|
2018-11-10 13:00:14 +00:00
|
|
|
aes_armv4.o : aes_armv4.S
|
2022-02-10 23:56:24 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_THUMB_FLAG) -c) $<
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2020-02-08 17:16:52 +00:00
|
|
|
# Use C++ compiler on C source after patching.
|
|
|
|
# https://github.com/weidai11/cryptopp/issues/926
|
2018-12-01 17:48:47 +00:00
|
|
|
cpu-features.o: cpu-features.h cpu-features.c
|
2021-02-14 19:49:27 +00:00
|
|
|
$(CXX) -x c $(strip $(CPPFLAGS) $(NOSTD_CXXFLAGS) -c) cpu-features.c
|
Add ARMv8.4 cpu feature detection support (GH #685) (#687)
This PR adds ARMv8.4 cpu feature detection support. Previously we only needed ARMv8.1 and things were much easier. For example, ARMv8.1 `__ARM_FEATURE_CRYPTO` meant PMULL, AES, SHA-1 and SHA-256 were available. ARMv8.4 `__ARM_FEATURE_CRYPTO` means PMULL, AES, SHA-1, SHA-256, SHA-512, SHA-3, SM3 and SM4 are available.
We still use the same pattern as before. We make something available based on compiler version and/or preprocessor macros. But this time around we had to tighten things up a bit to ensure ARMv8.4 did not cross-pollinate down into ARMv8.1.
ARMv8.4 is largely untested at the moment. There is no hardware in the field and CI lacks QEMU with the relevant patches/support. We will probably have to revisit some of this stuff in the future.
Since this update applies to ARM gadgets we took the time to expand Android and iOS testing on Travis. Travis now tests more platforms, and includes Autotools and CMake builds, too.
2018-07-15 12:35:14 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# SSSE3 or NEON available
|
2018-11-10 13:00:14 +00:00
|
|
|
aria_simd.o : aria_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(ARIA_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# SSE, NEON or POWER7 available
|
|
|
|
blake2s_simd.o : blake2s_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(BLAKE2S_FLAG) -c) $<
|
2018-12-01 17:48:47 +00:00
|
|
|
|
|
|
|
# SSE, NEON or POWER8 available
|
|
|
|
blake2b_simd.o : blake2b_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(BLAKE2B_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
2018-10-27 16:59:29 +00:00
|
|
|
# SSE2 or NEON available
|
2018-11-10 13:00:14 +00:00
|
|
|
chacha_simd.o : chacha_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHACHA_FLAG) -c) $<
|
2018-10-27 16:59:29 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# AVX2 available
|
|
|
|
chacha_avx.o : chacha_avx.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHACHA_AVX2_FLAG) -c) $<
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2018-06-19 22:03:28 +00:00
|
|
|
# SSSE3 available
|
2018-11-10 13:00:14 +00:00
|
|
|
cham_simd.o : cham_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHAM_FLAG) -c) $<
|
2018-06-19 22:03:28 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# Power9 available
|
|
|
|
darn.o : darn.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(DARN_FLAG) -c) $<
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2018-12-13 15:19:54 +00:00
|
|
|
# SSE2 on i686
|
|
|
|
donna_sse.o : donna_sse.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SSE2_FLAG) -c) $<
|
2018-12-13 15:19:54 +00:00
|
|
|
|
|
|
|
# SSE2 on i686
|
2018-12-01 17:48:47 +00:00
|
|
|
sse_simd.o : sse_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SSE2_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
|
|
|
# SSE4.2 or ARMv8a available
|
2018-11-10 13:00:14 +00:00
|
|
|
crc_simd.o : crc_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CRC_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
|
|
|
# PCLMUL or ARMv7a/ARMv8a available
|
2018-11-10 13:00:14 +00:00
|
|
|
gcm_simd.o : gcm_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(GCM_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
2020-07-29 16:21:42 +00:00
|
|
|
# Carryless multiply
|
|
|
|
gf2n_simd.o : gf2n_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(GF2N_FLAG) -c) $<
|
2020-07-29 16:21:42 +00:00
|
|
|
|
2021-02-07 06:19:18 +00:00
|
|
|
# SSSE3 available
|
|
|
|
keccak_simd.o : keccak_simd.cpp
|
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(KECCAK_FLAG) -c) $<
|
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# SSSE3 available
|
2018-11-10 13:00:14 +00:00
|
|
|
lea_simd.o : lea_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LEA_FLAG) -c) $<
|
2018-06-22 20:26:27 +00:00
|
|
|
|
2021-04-26 08:50:48 +00:00
|
|
|
# SSSE3 available
|
|
|
|
lsh256_sse.o : lsh256_sse.cpp
|
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH256_FLAG) -c) $<
|
|
|
|
|
|
|
|
# AVX2 available
|
|
|
|
lsh256_avx.o : lsh256_avx.cpp
|
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH256_AVX2_FLAG) -c) $<
|
|
|
|
|
|
|
|
# SSSE3 available
|
|
|
|
lsh512_sse.o : lsh512_sse.cpp
|
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH512_FLAG) -c) $<
|
|
|
|
|
|
|
|
# AVX2 available
|
|
|
|
lsh512_avx.o : lsh512_avx.cpp
|
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH512_AVX2_FLAG) -c) $<
|
|
|
|
|
2017-09-13 21:16:57 +00:00
|
|
|
# NEON available
|
2018-11-10 13:00:14 +00:00
|
|
|
neon_simd.o : neon_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(NEON_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
|
|
|
# AESNI or ARMv7a/ARMv8a available
|
2018-11-10 13:00:14 +00:00
|
|
|
rijndael_simd.o : rijndael_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(AES_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
|
|
|
# SSE4.2/SHA-NI or ARMv8a available
|
2018-11-10 13:00:14 +00:00
|
|
|
sha_simd.o : sha_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SHA_FLAG) -c) $<
|
2017-09-13 21:16:57 +00:00
|
|
|
|
2022-02-11 00:01:39 +00:00
|
|
|
# Cryptogams SHA1/SHA256/SHA512 asm implementation.
|
|
|
|
sha%_armv4.o : sha%_armv4.S
|
2022-02-10 23:56:24 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_FLAG) -c) $<
|
2019-05-19 20:29:45 +00:00
|
|
|
|
2017-09-13 21:16:57 +00:00
|
|
|
# SSE4.2/SHA-NI or ARMv8a available
|
2018-11-10 13:00:14 +00:00
|
|
|
shacal2_simd.o : shacal2_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SHA_FLAG) -c) $<
|
2017-09-13 11:16:41 +00:00
|
|
|
|
2018-08-16 22:24:22 +00:00
|
|
|
# SSSE3, NEON or POWER8 available
|
2018-11-10 13:00:14 +00:00
|
|
|
simon128_simd.o : simon128_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SIMON128_FLAG) -c) $<
|
2018-08-16 22:24:22 +00:00
|
|
|
|
|
|
|
# SSSE3, NEON or POWER8 available
|
2018-11-10 13:00:14 +00:00
|
|
|
speck128_simd.o : speck128_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SPECK128_FLAG) -c) $<
|
2018-02-19 04:23:50 +00:00
|
|
|
|
2018-12-01 17:48:47 +00:00
|
|
|
# ARMv8.4 available
|
|
|
|
sm3_simd.o : sm3_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SM3_FLAG) -c) $<
|
2018-12-01 17:48:47 +00:00
|
|
|
|
2018-07-13 12:33:13 +00:00
|
|
|
# AESNI available
|
2018-11-10 13:00:14 +00:00
|
|
|
sm4_simd.o : sm4_simd.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SM4_FLAG) -c) $<
|
2018-07-13 12:33:13 +00:00
|
|
|
|
2015-06-08 11:50:22 +00:00
|
|
|
%.o : %.cpp
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) -c) $<
|
2015-07-20 10:55:42 +00:00
|
|
|
|
2018-10-27 15:34:11 +00:00
|
|
|
.PHONY: dep deps depend
|
|
|
|
dep deps depend GNUmakefile.deps:
|
2021-01-01 15:50:40 +00:00
|
|
|
$(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS)) -MM *.cpp > GNUmakefile.deps
|