aboutsummaryrefslogtreecommitdiff
path: root/mk/cc.mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-19 16:49:28 +0000
committerRoy Marples <roy@marples.name>2008-02-19 16:49:28 +0000
commit42dd9965ccfbbdd93a1edb996d5bf8b77e3dc940 (patch)
treefac84b37f09a46130ac1fb50412fe9934c3c6695 /mk/cc.mk
parent916a4463ce64d3dbf54a98d17947379e72d907e8 (diff)
Default to using C99 standard.
Diffstat (limited to 'mk/cc.mk')
-rw-r--r--mk/cc.mk6
1 files changed, 5 insertions, 1 deletions
diff --git a/mk/cc.mk b/mk/cc.mk
index 225b1104..9bfd123d 100644
--- a/mk/cc.mk
+++ b/mk/cc.mk
@@ -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}
-