2021-02-11 06:49:19 +08:00
|
|
|
#
|
2023-11-11 03:02:00 +08:00
|
|
|
# To run the demos when linked with a shared library (default) ensure
|
|
|
|
# that libcrypto is on the library path. For example:
|
2021-02-11 06:49:19 +08:00
|
|
|
#
|
|
|
|
# LD_LIBRARY_PATH=../.. ./EVP_MD_demo
|
|
|
|
|
2023-11-11 03:02:00 +08:00
|
|
|
TESTS = EVP_MD_demo \
|
|
|
|
EVP_MD_stdin \
|
|
|
|
EVP_MD_xof \
|
|
|
|
BIO_f_md
|
2021-02-11 06:49:19 +08:00
|
|
|
|
2023-11-11 03:02:00 +08:00
|
|
|
CFLAGS = -I../../include -g -Wall
|
|
|
|
LDFLAGS = -L../..
|
|
|
|
LDLIBS = -lcrypto
|
2023-03-20 13:08:38 +08:00
|
|
|
|
|
|
|
all: $(TESTS)
|
2021-02-11 06:49:19 +08:00
|
|
|
|
|
|
|
EVP_MD_demo: EVP_MD_demo.o
|
|
|
|
EVP_MD_stdin: EVP_MD_stdin.o
|
2022-03-03 16:20:05 +08:00
|
|
|
EVP_MD_xof: EVP_MD_xof.o
|
2021-02-11 06:49:19 +08:00
|
|
|
BIO_f_md: BIO_f_md.o
|
|
|
|
|
2023-11-11 03:02:00 +08:00
|
|
|
$(TESTS):
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LDLIBS)
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) *.o $(TESTS)
|
|
|
|
|
2023-03-20 13:08:38 +08:00
|
|
|
.PHONY: test
|
2023-11-11 03:02:00 +08:00
|
|
|
# Since some of these tests use stdin, we use the source file as stdin
|
|
|
|
# when running the tests
|
2023-03-20 13:08:38 +08:00
|
|
|
test: all
|
|
|
|
@echo "\nDigest tests:"
|
|
|
|
@set -e; for tst in $(TESTS); do \
|
|
|
|
echo "\n"$$tst; \
|
|
|
|
cat $$tst.c | ./$$tst; \
|
|
|
|
done
|