From 30cfeb722b94be3cdbb939227d365e3a8a320588 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Mon, 20 Nov 2017 13:26:16 +0100 Subject: [PATCH] build-style/gnu-makefile.sh: use "make check" if available. --- common/build-style/gnu-makefile.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/common/build-style/gnu-makefile.sh b/common/build-style/gnu-makefile.sh index 123eba57468..a2ba1a005a9 100644 --- a/common/build-style/gnu-makefile.sh +++ b/common/build-style/gnu-makefile.sh @@ -15,6 +15,24 @@ do_build() { fi } +do_check() { + if [ -z "$make_cmd" ] && [ -z "$make_check_target" ]; then + if make -q check 2>/dev/null; then + : + else + if [ $? -eq 2 ]; then + msg_warn 'No target to "make check".\n' + return 0 + fi + fi + fi + + : ${make_cmd:=make} + : ${make_check_target:=check} + + ${make_cmd} ${make_check_args} ${make_check_target} +} + do_install() { : ${make_cmd:=make} : ${make_install_target:=install}