aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Duncan <pabs@pablotron.org>2024-05-09 01:50:14 -0400
committerPaul Duncan <pabs@pablotron.org>2024-05-09 01:50:14 -0400
commit061dc7ec46e7e2dba7b8c3ef6f09d7d383ad692c (patch)
treeb0edd14c90026ad4df158538a3b6b7b2e9df41ee
parent8363e3c6a128f02a4b8fa2edf877c0fe26629a46 (diff)
downloadsha3-061dc7ec46e7e2dba7b8c3ef6f09d7d383ad692c.tar.bz2
sha3-061dc7ec46e7e2dba7b8c3ef6f09d7d383ad692c.zip
examples/*/Makefile, tests/*/Makefile: add BACKEND support, mark clean target as phonyv0.8
-rw-r--r--examples/00-sha3-256/Makefile7
-rw-r--r--examples/01-shake128/Makefile7
-rw-r--r--examples/02-kmac128/Makefile7
-rw-r--r--examples/03-tuplehash128/Makefile7
-rw-r--r--examples/04-turboshake128/Makefile7
-rw-r--r--examples/06-all/Makefile7
-rw-r--r--tests/cavp-tests/Makefile7
-rw-r--r--tests/fuzz/Makefile5
-rw-r--r--tests/permute/Makefile2
9 files changed, 40 insertions, 16 deletions
diff --git a/examples/00-sha3-256/Makefile b/examples/00-sha3-256/Makefile
index 198831b..819dc63 100644
--- a/examples/00-sha3-256/Makefile
+++ b/examples/00-sha3-256/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./sha3-256-example
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/examples/01-shake128/Makefile b/examples/01-shake128/Makefile
index f5080cd..bbe1395 100644
--- a/examples/01-shake128/Makefile
+++ b/examples/01-shake128/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./shake128-example
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/examples/02-kmac128/Makefile b/examples/02-kmac128/Makefile
index ae267f9..266dcba 100644
--- a/examples/02-kmac128/Makefile
+++ b/examples/02-kmac128/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./kmac128-example
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/examples/03-tuplehash128/Makefile b/examples/03-tuplehash128/Makefile
index cbbd3a9..c0618ca 100644
--- a/examples/03-tuplehash128/Makefile
+++ b/examples/03-tuplehash128/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./tuplehash128-example
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/examples/04-turboshake128/Makefile b/examples/04-turboshake128/Makefile
index 020ca7c..4706e0e 100644
--- a/examples/04-turboshake128/Makefile
+++ b/examples/04-turboshake128/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./turbohash128-example
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/examples/06-all/Makefile b/examples/06-all/Makefile
index f29c034..5685060 100644
--- a/examples/06-all/Makefile
+++ b/examples/06-all/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./all-fns
OBJS=sha3.o all-fns.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/tests/cavp-tests/Makefile b/tests/cavp-tests/Makefile
index 7d5ac47..2de46f8 100644
--- a/tests/cavp-tests/Makefile
+++ b/tests/cavp-tests/Makefile
@@ -1,8 +1,11 @@
-CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=native -DBACKEND=$(BACKEND)
APP=./cavp-tests
OBJS=sha3.o main.o
-.PHONY=all
+.PHONY=all clean
all: $(APP)
diff --git a/tests/fuzz/Makefile b/tests/fuzz/Makefile
index 9c305a8..0558ac9 100644
--- a/tests/fuzz/Makefile
+++ b/tests/fuzz/Makefile
@@ -1,4 +1,7 @@
-CFLAGS=-g -fsanitize=address,fuzzer -W -Wall -Wextra -Werror -pedantic -std=c11
+# backend (0 to auto-detect)
+BACKEND ?= 0
+
+CFLAGS=-g -fsanitize=address,fuzzer -W -Wall -Wextra -Werror -pedantic -std=c11 -DBACKEND=$(BACKEND)
APP=./fuzz-shake128
OBJS=sha3.o fuzz.o
CC=clang
diff --git a/tests/permute/Makefile b/tests/permute/Makefile
index 142014c..5a83187 100644
--- a/tests/permute/Makefile
+++ b/tests/permute/Makefile
@@ -2,7 +2,7 @@ CFLAGS=-W -Wall -Wextra -Werror -pedantic -std=c11 -O3 -march=native -mtune=nati
APP=./test-permute
OBJS=permute.o
-.PHONY=test all
+.PHONY=test all clean
all: $(APP)