summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2024-05-05 11:41:46 -0400
committerPaul Duncan <pabs@pablotron.org>2024-05-05 11:41:46 -0400
commit6678b734ef7e91e0cf91d748910b778891a53e88 (patch)
treecd94781cb48f54d31e45a59337512d2263617245 /Makefile
parentc8536f5094f58db837e5d30f5c24aa1aaabe8eef (diff)
downloadsha3-6678b734ef7e91e0cf91d748910b778891a53e88.tar.bz2
sha3-6678b734ef7e91e0cf91d748910b778891a53e88.zip
sha3.c, Makefile, tests/bench/Makefile: allow overriding SHA3_BACKEND via command-line argument
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index dfc0e0f..bdaf13e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,8 @@
+# backend (0 to auto-detect)
+SHA3_BACKEND ?= 0
+
# compiler flags used for sample application and shared library
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -fPIC -O3 -march=native -mtune=native
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -fPIC -O3 -march=native -mtune=native -DSHA3_BACKEND=$(SHA3_BACKEND)
# sample application
APP=./sha3
@@ -10,7 +13,7 @@ LIB=libsha3.so
LIB_OBJS=sha3.o
# test app (test suite and sanitizers)
-TEST_CFLAGS=-g -fsanitize=address,pointer-compare,pointer-subtract,undefined,leak -W -Wall -Wextra -Werror -pedantic -std=c11 -march=native -mtune=native
+TEST_CFLAGS=-g -fsanitize=address,pointer-compare,pointer-subtract,undefined,leak -W -Wall -Wextra -Werror -pedantic -std=c11 -march=native -mtune=native -DSHA3_BACKEND=$(SHA3_BACKEND)
TEST_APP=./test-sha3
.PHONY=test all