From bfbe6851afd2eb5b40b23dcb7ce6a9422b0f17fa Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 28 Aug 2024 16:10:48 -0400 Subject: build: Move the "compiler works at all" test earlier --- build/flags.mk | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'build/flags.mk') diff --git a/build/flags.mk b/build/flags.mk index ad2a75e..504df63 100644 --- a/build/flags.mk +++ b/build/flags.mk @@ -123,6 +123,13 @@ gen/flags.mk: ${AUTO_FLAGS} ${VCAT} $@ .PHONY: gen/flags.mk +# Check that the C compiler works at all +cc:: + @build/cc.sh -q build/empty.c -o gen/.cc.out; \ + ret=$$?; \ + build/msg-if.sh "[ CC ] build/empty.c" test $$ret -eq 0; \ + exit $$ret + # The short name of the config test SLUG = ${@:gen/%.mk=%} # The source file to build @@ -130,7 +137,8 @@ CSRC = build/${SLUG}.c # The hidden output file name OUT = ${SLUG:flags/%=gen/flags/.%.out} -${AUTO_FLAGS}:: +${AUTO_FLAGS}: cc @${MKDIR} ${@D} @build/flags-if.sh ${CSRC} -o ${OUT} >$@ 2>$@.log; \ build/msg-if.sh "[ CC ] ${SLUG}.c" test $$? -eq 0 +.PHONY: ${AUTO_FLAGS} -- cgit v1.2.3