From 36fa20d1764acd5d84e35e66e8c7efb1e7c523ad Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Tue, 26 Oct 2021 11:26:32 +0200 Subject: Makefile: Revise C compiler check Clean up the compiler target by outsourcing the test to an own variable. Change the print output and don't write to the build-details file. This is in preparation for further changes. Change-Id: I3d6f08ef030744c772b4ec0dc2c9e614fb90461d Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/58616 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- Makefile.include | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'Makefile.include') diff --git a/Makefile.include b/Makefile.include index ca70d051..2b5a3447 100644 --- a/Makefile.include +++ b/Makefile.include @@ -36,15 +36,9 @@ define c_macro_test $(strip $(shell $(CC) -E $1 2>/dev/null | tail -1 | tr -d '"')) endef -define COMPILER_TEST -int main(int argc, char **argv) -{ - (void) argc; - (void) argv; - return 0; -} +define c_compile_test +$(shell $(CC) -c -Wall -Werror -o /dev/null $1 2>/dev/null && echo yes || echo no) endef -export COMPILER_TEST define LIBPCI_TEST /* Avoid a failing test due to libpci header symbol shadowing breakage */ -- cgit v1.2.3