summaryrefslogtreecommitdiffstats
path: root/demos/mac
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2023-03-20 15:08:38 +1000
committerMatt Caswell <matt@openssl.org>2023-10-25 09:21:07 +0100
commit66f4782f1452d6fbfab78822b340a99aaeacc2f0 (patch)
tree063d3ad8628b8b10260b4316531f78de9d83b0c1 /demos/mac
parentdbbdb940d421daca4a65e765b5244bde6aed3f61 (diff)
Create hierarchical demo Makefile.
Adds a Makefile with all, clean, and test targets. This has only been added for demos that already contain Makefiles. For problematic tests that require inputs, the test target does nothing. (Note: Demos should be self contained and not require unknown external inputs. This PR does not attempt to fix this.) Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20546)
Diffstat (limited to 'demos/mac')
-rw-r--r--demos/mac/Makefile14
1 files changed, 12 insertions, 2 deletions
diff --git a/demos/mac/Makefile b/demos/mac/Makefile
index 00d2d8dbe6..629e77dfc2 100644
--- a/demos/mac/Makefile
+++ b/demos/mac/Makefile
@@ -11,7 +11,9 @@
CFLAGS = $(OPENSSL_INCS_LOCATION) -Wall
LDFLAGS = $(OPENSSL_LIBS_LOCATION) -lssl -lcrypto
-all: gmac hmac-sha512 cmac-aes256 poly1305
+TESTS=gmac hmac-sha512 cmac-aes256 poly1305
+
+all: $(TESTS)
gmac: gmac.o
hmac-sha512: hmac-sha512.o
@@ -22,4 +24,12 @@ gmac hmac-sha512 cmac-aes256 poly1305:
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)
clean:
- $(RM) gmac hmac-sha512 cmac-aes256 poly1305 *.o
+ $(RM) *.o $(TESTS)
+
+.PHONY: test
+test: all
+ @echo "\nMAC tests:"
+ @set -e; for tst in $(TESTS); do \
+ echo "\n"$$tst; \
+ LD_LIBRARY_PATH=../.. ./$$tst; \
+ done