Makefile: Add -Werror to try-cflag so it works on clang
Clangs prints warnings when it sees unknown command line options. Adding
Werror to the command line to upgrade them to errors results in clang
exiting with exit code 1 which is what try-cflag expects.
@@ -20,8 +20,8 @@ try = $(shell set -e; if ($(1)) >/dev/null 2>&1; \
then echo "$(2)"; \
else echo "$(3)"; fi )
-try-cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,$(2))
-test_cflag = $(call try,$(1) $(2) -x c -c /dev/null -o /dev/null,1,0)
+try-cflag = $(call try,$(1) -Werror $(2) -x c -c /dev/null -o /dev/null,$(2))
+test_cflag = $(call try,$(1) -Werror $(2) -x c -c /dev/null -o /dev/null,1,0)
cc-name := $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
