Test for >= gcc 4, and change to g99 -std=gnu99 for the compiler if it is found.

This commit is contained in:
Warren Melnick 2017-05-29 10:42:37 -04:00
parent bf0f604e34
commit ae3c34084f

View file

@ -5,6 +5,10 @@ UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
LIBS= LIBS=
endif endif
GCCVERSIONGTEQ4 := $(shell expr `gcc -dumpversion | cut -f1 -d.` \>= 4)
ifeq "$(GCCVERSIONGTEQ4)" "1"
CC=c99 --std=gnu99
endif
OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o OBJS=main.o init.o actions1.o actions2.o score.o misc.o database.o
SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control