summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2022-12-09 09:56:42 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2022-12-09 09:56:42 +0000
commitbb1703b8b90e77073dfaa94ba4bb8117c014c48f (patch)
tree147c4a3d01ac3670c28d0fc1a671ac26022c9bc2 /regress
parent712510118ae4253f819758c0cf6581d046040655 (diff)
bn/Makefile: tidy up and simplify
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/bn/Makefile26
1 files changed, 10 insertions, 16 deletions
diff --git a/regress/lib/libcrypto/bn/Makefile b/regress/lib/libcrypto/bn/Makefile
index 1ab947a9f19..e95091aeb52 100644
--- a/regress/lib/libcrypto/bn/Makefile
+++ b/regress/lib/libcrypto/bn/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.15 2022/12/02 17:34:26 tb Exp $
+# $OpenBSD: Makefile,v 1.16 2022/12/09 09:56:41 tb Exp $
PROGS += bn_add_sub
PROGS += bn_cmp
@@ -10,6 +10,7 @@ PROGS += bn_mod_sqrt
PROGS += bn_mont
PROGS += bn_primes
PROGS += bn_rand_interval
+PROGS += bn_test
PROGS += bn_to_string
PROGS += bn_unit
@@ -18,6 +19,7 @@ STATIC_LINK += bn_mod_exp
STATIC_LINK += bn_mod_exp_zero
STATIC_LINK += bn_primes
STATIC_LINK += bn_rand_interval
+STATIC_LINK += bn_test
STATIC_LINK += bn_to_string
LDADD = -lcrypto
@@ -26,20 +28,14 @@ WARNINGS = Yes
CFLAGS += -Wall -Wundef -Werror
CFLAGS += -I${.CURDIR}/../../../../lib/libcrypto/bn/
-.for p in ${PROGS}
-REGRESS_TARGETS += run-$p
-.PHONY: run-$p
-
-run-$p: $p
- ./$p
-.endfor
+# Use default targets from bsd.regress.mk unless overridden below
+REGRESS_TARGETS = ${PROGS:S/^/run-regress-/}
# Verify that the bn_isqrt -C output isn't changed by accident.
isqrt-print-tables: bn_isqrt
@./bn_isqrt -C
.PHONY: isqrt-print-tables
-CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt
bn_isqrt_gen_tables.txt: bn_isqrt
${.MAKE} -C ${.CURDIR} isqrt-print-tables > $@.tmp
mv -f $@.tmp $@
@@ -49,14 +45,10 @@ REGRESS_TARGETS += run-bn_isqrt_check_tables
run-bn_isqrt_check_tables: bn_isqrt_gen_tables.txt
diff -pu ${.CURDIR}/bn_isqrt_tables.txt bn_isqrt_gen_tables.txt
-# Keep bn_test last since it is special
-PROGS += bn_test
-STATIC_LINK += bn_test
-CLEANFILES += bn_test.out bc.out
+CLEANFILES += bn_isqrt_gen_tables.txt.tmp bn_isqrt_gen_tables.txt
-REGRESS_TARGETS += run-bn_test
-.PHONY: run-bn_test
-run-bn_test bntest.out: bn_test
+# bn_test is special, so override bsd.regress.mk's run-regress-bn_test
+run-regress-bn_test bntest.out: bn_test
./bn_test -out bn_test.out
REGRESS_TARGETS += run-bc
@@ -65,6 +57,8 @@ run-bc: bn_test.out
bc < $> | tee bc.out | grep -v '^0$$'
! grep -v '^test ' <bc.out | grep -v '^0$$'
+CLEANFILES += bn_test.out bc.out
+
.for p in ${STATIC_LINK}
LDADD_$p += ${CRYPTO_INT}
.endfor