From ba275d8bdb1eacd357b942b0aa7df5612f751fc5 Mon Sep 17 00:00:00 2001 From: Thomas Heijligen Date: Tue, 28 Sep 2021 15:22:34 +0200 Subject: Makefile: move determination test for OS to Makefile.d Move the test code for OS detection in a extra directory to split it from the main flashrom code. Change-Id: Id911f17f4100f242e1fde10d23a8459ddf38b369 Signed-off-by: Thomas Heijligen Reviewed-on: https://review.coreboot.org/c/flashrom/+/58015 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber --- Makefile.include | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Makefile.include') diff --git a/Makefile.include b/Makefile.include index 36746c805..ca70d0514 100644 --- a/Makefile.include +++ b/Makefile.include @@ -31,6 +31,10 @@ $(foreach p,$1, \ $(eval override $(p) := no)) endef +# Run the C Preprocessor with file $1 and return the last line, removing quotes. +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) -- cgit v1.2.3