1# $OpenBSD: Makefile,v 1.9 2023/07/08 19:41:07 tb Exp $ 2 3WYCHEPROOF_TESTVECTORS = /usr/local/share/wycheproof/testvectors/ 4 5.if !exists(${WYCHEPROOF_TESTVECTORS}) 6regress: 7 @echo package wycheproof-testvectors is required for this regress 8 @echo package go should be installed if available 9 @echo SKIPPED 10.else 11 12REGRESS_TARGETS += regress-wycheproof-primes 13 14. if exists(/usr/local/bin/go) 15 16REGRESS_TARGETS += regress-wycheproof 17 18CLEANFILES += wycheproof 19 20wycheproof: wycheproof.go 21 go build -o wycheproof ${.CURDIR}/wycheproof.go 22 23regress-wycheproof: wycheproof 24 ./wycheproof 25 26. endif 27 28PROGS += wycheproof-primes 29 30LDADD += -lcrypto 31DPADD += ${LIBCRYPTO} 32CFLAGS += -I${.CURDIR} -I${.OBJDIR} 33 34primality_testcases.h: wycheproof-json.pl ${WYCHEPROOF_TESTVECTORS}/primality_test.json 35 perl ${.CURDIR}/wycheproof-json.pl > $@.tmp && mv $@.tmp $@ 36 37wycheproof-primes.o: primality_testcases.h 38 39regress-wycheproof-primes: wycheproof-primes 40 ./wycheproof-primes 41 42CLEANFILES += primality_testcases.h 43 44.endif 45 46.include <bsd.regress.mk> 47