From ae3c34084f2afe7332973ab20fcaf1a29264c078 Mon Sep 17 00:00:00 2001 From: Warren Melnick Date: Mon, 29 May 2017 10:42:37 -0400 Subject: [PATCH] Test for >= gcc 4, and change to g99 -std=gnu99 for the compiler if it is found. --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 8a30613..7526a71 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,10 @@ UNAME_S := $(shell uname -s) ifeq ($(UNAME_S),Darwin) LIBS= 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 SOURCES=$(OBJS:.o=.c) COPYING NEWS README TODO advent.text control -- 2.31.1