From bfc8fe3717297854fb29e74ce27a2cc98e4e8cff Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 12 Oct 2024 20:30:42 +1100 Subject: [PATCH] Tweaked CFLAGS in each makefile --- makefile | 9 +++++---- repl/makefile | 2 +- source/makefile | 2 +- tests/makefile | 13 +++++++------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/makefile b/makefile index d29c463..aef91a7 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,8 @@ -#compiler settings -CC=gcc -CFLAGS+=-std=c17 -pedantic -Werror -LIBS+=-lm +#compiler settings reference +#CC=gcc +#CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2 +#LIBS+=-lm +#LDFLAGS+= #directories export TOY_SOURCEDIR=source diff --git a/repl/makefile b/repl/makefile index 1738a97..704d5df 100644 --- a/repl/makefile +++ b/repl/makefile @@ -1,6 +1,6 @@ #compiler settings CC=gcc -CFLAGS+=-g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable +CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2 LIBS+=-lm -lToy LDFLAGS+=-Wl,-rpath,'$$ORIGIN' diff --git a/source/makefile b/source/makefile index 949fdf3..6d30727 100644 --- a/source/makefile +++ b/source/makefile @@ -1,6 +1,6 @@ #compiler settings CC=gcc -CFLAGS+=-g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable +CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2 LIBS+=-lm LDFLAGS+= diff --git a/tests/makefile b/tests/makefile index d7e4262..746e13d 100644 --- a/tests/makefile +++ b/tests/makefile @@ -1,16 +1,17 @@ #compiler settings CC=gcc -CFLAGS=-g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -LIBS=-lm +CFLAGS+=-std=c17 -g -Wall -Werror -Wno-unused-parameter -Wno-unused-function -Wno-unused-variable -Wformat=2 +LIBS+=-lm +LDFLAGS+= ifeq ($(shell uname),Linux) -LDFLAG=-Wl,--gc-sections +LDFLAGS=-Wl,--gc-sections else ifeq ($(OS),Windows_NT) -LDFLAG=-Wl,--gc-sections +LDFLAGS=-Wl,--gc-sections else ifeq ($(shell uname),Darwin) -LDFLAG=-Wl,-dead_strip +LDFLAGS=-Wl,-dead_strip else - @echo "LDFLAG set failed - what platform is this?" + @echo "LDFLAGS set failed - what platform is this?" endif #directories