summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2022-12-09 09:56:41 +0000
committertb <>2022-12-09 09:56:41 +0000
commitaf3392e24dc0f32002712971ca329757d0e91e79 (patch)
tree9803119c90aca74fd159d01417bc4f68c6996b01
parent1709b6023fb4add984f3c924c3cca37e5238b983 (diff)
downloadopenbsd-af3392e24dc0f32002712971ca329757d0e91e79.tar.gz
openbsd-af3392e24dc0f32002712971ca329757d0e91e79.tar.bz2
openbsd-af3392e24dc0f32002712971ca329757d0e91e79.zip
bn/Makefile: tidy up and simplify
-rw-r--r--src/regress/lib/libcrypto/bn/Makefile26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/regress/lib/libcrypto/bn/Makefile b/src/regress/lib/libcrypto/bn/Makefile
index 1ab947a9f1..e95091aeb5 100644
--- a/src/regress/lib/libcrypto/bn/Makefile
+++ b/src/regress/lib/libcrypto/bn/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.15 2022/12/02 17:34:26 tb Exp $ 1# $OpenBSD: Makefile,v 1.16 2022/12/09 09:56:41 tb Exp $
2 2
3PROGS += bn_add_sub 3PROGS += bn_add_sub
4PROGS += bn_cmp 4PROGS += bn_cmp
@@ -10,6 +10,7 @@ PROGS += bn_mod_sqrt
10PROGS += bn_mont 10PROGS += bn_mont
11PROGS += bn_primes 11PROGS += bn_primes
12PROGS += bn_rand_interval 12PROGS += bn_rand_interval
13PROGS += bn_test
13PROGS += bn_to_string 14PROGS += bn_to_string
14PROGS += bn_unit 15PROGS += bn_unit
15 16
@@ -18,6 +19,7 @@ STATIC_LINK += bn_mod_exp
18STATIC_LINK += bn_mod_exp_zero 19STATIC_LINK += bn_mod_exp_zero
19STATIC_LINK += bn_primes 20STATIC_LINK += bn_primes
20STATIC_LINK += bn_rand_interval 21STATIC_LINK += bn_rand_interval
22STATIC_LINK += bn_test
21STATIC_LINK += bn_to_string 23STATIC_LINK += bn_to_string
22 24
23LDADD = -lcrypto 25LDADD = -lcrypto
@@ -26,20 +28,14 @@ WARNINGS = Yes
26CFLAGS += -Wall -Wundef -Werror 28CFLAGS += -Wall -Wundef -Werror
27CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/bn/ 29CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/bn/
28 30
29.for p in ${PROGS} 31# Use default targets from bsd.regress.mk unless overridden below
30REGRESS_TARGETS += run-$p 32REGRESS_TARGETS = ${PROGS:S/^/run-regress-/}
31.PHONY: run-$p
32
33run-$p: $p
34 ./$p
35.endfor
36 33
37# Verify that the bn_isqrt -C output isn't changed by accident. 34# Verify that the bn_isqrt -C output isn't changed by accident.
38isqrt-print-tables: bn_isqrt 35isqrt-print-tables: bn_isqrt
39 @./bn_isqrt -C 36 @./bn_isqrt -C
40.PHONY: isqrt-print-tables 37.PHONY: isqrt-print-tables
41 38
42CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt
43bn_isqrt_gen_tables.txt: bn_isqrt 39bn_isqrt_gen_tables.txt: bn_isqrt
44 ${.MAKE} -C ${.CURDIR} isqrt-print-tables > $@.tmp 40 ${.MAKE} -C ${.CURDIR} isqrt-print-tables > $@.tmp
45 mv -f $@.tmp $@ 41 mv -f $@.tmp $@
@@ -49,14 +45,10 @@ REGRESS_TARGETS += run-bn_isqrt_check_tables
49run-bn_isqrt_check_tables: bn_isqrt_gen_tables.txt 45run-bn_isqrt_check_tables: bn_isqrt_gen_tables.txt
50 diff -pu ${.CURDIR}/bn_isqrt_tables.txt bn_isqrt_gen_tables.txt 46 diff -pu ${.CURDIR}/bn_isqrt_tables.txt bn_isqrt_gen_tables.txt
51 47
52# Keep bn_test last since it is special 48CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt
53PROGS += bn_test
54STATIC_LINK += bn_test
55CLEANFILES += bn_test.out bc.out
56 49
57REGRESS_TARGETS += run-bn_test 50# bn_test is special, so override bsd.regress.mk's run-regress-bn_test
58.PHONY: run-bn_test 51run-regress-bn_test bntest.out: bn_test
59run-bn_test bntest.out: bn_test
60 ./bn_test -out bn_test.out 52 ./bn_test -out bn_test.out
61 53
62REGRESS_TARGETS += run-bc 54REGRESS_TARGETS += run-bc
@@ -65,6 +57,8 @@ run-bc: bn_test.out
65 bc < $> | tee bc.out | grep -v '^0$$' 57 bc < $> | tee bc.out | grep -v '^0$$'
66 ! grep -v '^test ' <bc.out | grep -v '^0$$' 58 ! grep -v '^test ' <bc.out | grep -v '^0$$'
67 59
60CLEANFILES += bn_test.out bc.out
61
68.for p in ${STATIC_LINK} 62.for p in ${STATIC_LINK}
69LDADD_$p += ${CRYPTO_INT} 63LDADD_$p += ${CRYPTO_INT}
70.endfor 64.endfor