From 5778c026f64546aa00771be6feb1db3bf2da5b21 Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Fri, 29 Oct 2010 14:41:05 -0300 Subject: [PATCH] Move flavors (variants) to Config.mak Also move any other compiler flag that should be user-defined to Config.mak, as they should not be imposed to the user. --- Config.mak | 25 +++++++++++++++++++++++++ Makeit.mak | 30 +++--------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/Config.mak b/Config.mak index 6d27087..c32caac 100644 --- a/Config.mak +++ b/Config.mak @@ -8,3 +8,28 @@ CC := gcc # Use pre-compiled headers GCH := 1 +# Warn about everything +override CPPFLAGS += -Wall +override LDFLAGS += -Wall + +# Be standard compliant +override CFLAGS += -std=c99 -pedantic +override CXXFLAGS += -std=c++98 -pedantic + + +# Flavors (variants) flags +########################## + +ifeq ($F,dbg) +override CPPFLAGS += -ggdb -DDEBUG +endif + +ifeq ($F,opt) +override CPPFLAGS += -O2 -DNDEBUG +endif + +ifeq ($F,cov) +override CPPFLAGS += -ggdb -pg --coverage +override LDFLAGS += -pg --coverage +endif + diff --git a/Makeit.mak b/Makeit.mak index 6866422..8964fe2 100644 --- a/Makeit.mak +++ b/Makeit.mak @@ -38,8 +38,8 @@ COLOR_WARN ?= 00;36 # See COLOR_CMD comment for details. COLOR_OUT ?= 00;31 -# Flavor (variant), should be one of "dbg", "opt" or "cov" -F ?= opt +# Flavor (variant), can be defined by the user in Config.mak +F ?= default # Use C++ linker by default LINKER := $(CXX) @@ -311,43 +311,19 @@ valgrind = $(call exec,$(if $(VALGRIND),$(VALGRIND_CMD)) $1,\ # Overridden flags ################## -# Warn about everything -override CPPFLAGS += -Wall - # Use the includes directories to search for includes override CPPFLAGS += -I$(INCLUDE_DIR) # Let the program know where it will be installed override CPPFLAGS += -DPREFIX=$(prefix) -# Be standard compliant -override CFLAGS += -std=c99 -pedantic -override CXXFLAGS += -std=c++98 -pedantic - # Use the generated library directory to for libraries -override LDFLAGS += -L$L -Wall +override LDFLAGS += -L$L # Make sure the generated libraries can be found export LD_LIBRARY_PATH := $L:$(LD_LIBRARY_PATH) -# Variant flags -################ - -ifeq ($F,dbg) -override CPPFLAGS += -ggdb -DDEBUG -endif - -ifeq ($F,opt) -override CPPFLAGS += -O2 -DNDEBUG -endif - -ifeq ($F,cov) -override CPPFLAGS += -ggdb -pg --coverage -override LDFLAGS += -pg --coverage -endif - - # Automatic dependency handling ################################ -- 2.43.0