Default to using C99 standard.

This commit is contained in:
Roy Marples
2008-02-19 16:49:28 +00:00
parent 916a4463ce
commit 42dd9965cc
2 changed files with 11 additions and 6 deletions

View File

@@ -4,6 +4,11 @@
CFLAGS?= -O2 -pipe
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)
@@ -23,4 +28,3 @@ CFLAGS+= -pedantic \
$(call check_gcc, -Wdeclaration-after-statement) \
$(call check_gcc, -Wsequence-point) \
$(call check_gcc, -Wextra) ${WEXTRA}