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 <thomas.heijligen@secunet.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/58616
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/72251
Reviewed-by: Nico Huber <nico.h@gmx.de>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/Makefile.include b/Makefile.include
index 12fdd81..cffe47f 100644
--- a/Makefile.include
+++ b/Makefile.include
@@ -36,15 +36,9 @@
 $(strip $(shell $(CC) -E $1 2>/dev/null | tail -n 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 */