# Copyright 2008 Roy Marples <roy@marples.name>
# Setup some good default CFLAGS
-
CFLAGS?= -O2 -pipe
+# Default to using the C99 standard
+CSTD?= c99
+_CSTD_SH= if test -n "${CSTD}"; then echo "-std=${CSTD}"; else echo ""; fi
+_CSTD!= ${_CSTD_SH}
+CFLAGS+= ${_CSTD}$(shell _CSTD_SH)
+
# GNU Make way of detecting gcc flags we can use
check_gcc=$(shell if ${CC} $(1) -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "$(1)"; else echo "$(2)"; fi)