xref: /openbsd/regress/lib/libcrypto/bn/Makefile (revision b8d22d11)
1*b8d22d11Stb#	$OpenBSD: Makefile,v 1.8 2022/12/01 20:50:10 tb Exp $
23c6bd008Smiod
3*b8d22d11StbPROGS +=	bn_add_sub
4e34544d2SjsingPROGS +=	bn_cmp
5*b8d22d11StbPROGS +=	bn_isqrt
6*b8d22d11StbPROGS +=	bn_mod_exp2_mont
7*b8d22d11StbPROGS +=	bn_mod_sqrt
8*b8d22d11StbPROGS +=	bn_mont
9*b8d22d11StbPROGS +=	bn_primes
10*b8d22d11StbPROGS +=	bn_rand_interval
11*b8d22d11StbPROGS +=	bn_to_string
12*b8d22d11StbPROGS +=	bn_unit
13*b8d22d11Stb
14*b8d22d11StbSTATIC_LINK +=	bn_isqrt
15*b8d22d11StbSTATIC_LINK +=	bn_primes
16*b8d22d11StbSTATIC_LINK +=	bn_to_string
17*b8d22d11StbSTATIC_LINK +=	bn_rand_interval
183c6bd008Smiod
19e34544d2SjsingLDADD =		-lcrypto
20e34544d2SjsingDPADD =		${LIBCRYPTO}
21e34544d2SjsingWARNINGS =	Yes
22e34544d2SjsingCFLAGS +=	-Wall -Wundef -Werror
23*b8d22d11StbCFLAGS +=	-I${.CURDIR}/../../../../lib/libcrypto/bn/
241aba091eSmiod
25*b8d22d11Stb.for p in ${PROGS}
26*b8d22d11StbREGRESS_TARGETS +=	run-$p
27*b8d22d11Stb.PHONY +=		run-$p
28*b8d22d11Stb
29*b8d22d11Stbrun-$p: $p
30*b8d22d11Stb	./$p
31*b8d22d11Stb.endfor
32*b8d22d11Stb
33*b8d22d11Stbisqrt-print-tables: bn_isqrt
34*b8d22d11Stb	@./bn_isqrt -C
35*b8d22d11Stb
36*b8d22d11Stb# Keep bn_test last since it is special
37*b8d22d11StbPROGS +=	bn_test
38*b8d22d11StbSTATIC_LINK +=	bn_test
39*b8d22d11StbCLEANFILES +=	bn_test.out bc.out
40*b8d22d11Stb
41*b8d22d11StbREGRESS_TARGETS +=	run-bn_test
42*b8d22d11Stb.PHONY: 		run-bn_test
43*b8d22d11Stbrun-bn_test bntest.out: bn_test
44*b8d22d11Stb	./bn_test -out bn_test.out
45*b8d22d11Stb
46*b8d22d11StbREGRESS_TARGETS +=	run-bc
47*b8d22d11Stb.PHONY: 		run-bc
48*b8d22d11Stbrun-bc: bn_test.out
49*b8d22d11Stb	bc < $> | tee bc.out | grep -v '^0$$'
50*b8d22d11Stb	! grep -v '^test ' <bc.out | grep -v '^0$$'
51*b8d22d11Stb
52*b8d22d11Stb.for p in ${STATIC_LINK}
53*b8d22d11StbLDADD_$p +=	${CRYPTO_INT}
54*b8d22d11Stb.endfor
55*b8d22d11Stb
56*b8d22d11Stb.PHONY: isqrt-print-tables
57e34544d2Sjsing
58e34544d2Sjsing.include <bsd.regress.mk>
59