From 1a3aeedfbdd0365fd087ac8d1a36ee3bc4c2ad46 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 26 Aug 2015 10:58:44 +0200 Subject: [PATCH] Makefile: Centralize and update Debug/Release compile flags Release build should be compiled without asserts, hence NDEBUG. --- build/Makefile.lib.inc | 6 ++++++ build/rm48_hdk/Debug/GNUmakefile | 3 +-- build/rm48_hdk/Release/GNUmakefile | 3 +-- build/tms570_hdk/Debug/GNUmakefile | 3 +-- build/tms570_hdk/Release/GNUmakefile | 3 +-- build/tms570_hydctr/Debug/GNUmakefile | 3 +-- build/tms570_hydctr/Release/GNUmakefile | 3 +-- build/tms570_rpp/Debug/GNUmakefile | 3 +-- build/tms570_rpp/Release/GNUmakefile | 3 +-- 9 files changed, 14 insertions(+), 16 deletions(-) diff --git a/build/Makefile.lib.inc b/build/Makefile.lib.inc index 2418450..60f5d2b 100644 --- a/build/Makefile.lib.inc +++ b/build/Makefile.lib.inc @@ -31,6 +31,12 @@ include $(makefile_lib_inc_dir)/../Makefile.var include $(makefile_lib_inc_dir)/../common.mk include $(makefile_lib_inc_dir)/Makefile.rules +ifeq ($(rpp_lib_DEBUG),1) +RPP_CFLAGS += -g -O0 +else +RPP_CFLAGS += -O2 -DNDEBUG +endif + rpp_lib_c_OBJS = $(addsuffix .obj,$(basename $(filter %.c, $(rpp_lib_SOURCES)))) rpp_lib_asm_OBJS = $(addsuffix .obj,$(basename $(filter %.asm, $(rpp_lib_SOURCES)))) rpp_lib_OBJS = $(rpp_lib_c_OBJS) $(rpp_lib_asm_OBJS) diff --git a/build/rm48_hdk/Debug/GNUmakefile b/build/rm48_hdk/Debug/GNUmakefile index 6d47e9e..4f85678 100644 --- a/build/rm48_hdk/Debug/GNUmakefile +++ b/build/rm48_hdk/Debug/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 1 include ../../Makefile.lib.inc - -RPP_CFLAGS += -g -O0 diff --git a/build/rm48_hdk/Release/GNUmakefile b/build/rm48_hdk/Release/GNUmakefile index 16367b2..8f2db8b 100644 --- a/build/rm48_hdk/Release/GNUmakefile +++ b/build/rm48_hdk/Release/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 0 include ../../Makefile.lib.inc - -RPP_CFLAGS += -O2 diff --git a/build/tms570_hdk/Debug/GNUmakefile b/build/tms570_hdk/Debug/GNUmakefile index 6d47e9e..4f85678 100644 --- a/build/tms570_hdk/Debug/GNUmakefile +++ b/build/tms570_hdk/Debug/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 1 include ../../Makefile.lib.inc - -RPP_CFLAGS += -g -O0 diff --git a/build/tms570_hdk/Release/GNUmakefile b/build/tms570_hdk/Release/GNUmakefile index 16367b2..8f2db8b 100644 --- a/build/tms570_hdk/Release/GNUmakefile +++ b/build/tms570_hdk/Release/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 0 include ../../Makefile.lib.inc - -RPP_CFLAGS += -O2 diff --git a/build/tms570_hydctr/Debug/GNUmakefile b/build/tms570_hydctr/Debug/GNUmakefile index 6d47e9e..4f85678 100644 --- a/build/tms570_hydctr/Debug/GNUmakefile +++ b/build/tms570_hydctr/Debug/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 1 include ../../Makefile.lib.inc - -RPP_CFLAGS += -g -O0 diff --git a/build/tms570_hydctr/Release/GNUmakefile b/build/tms570_hydctr/Release/GNUmakefile index 16367b2..8f2db8b 100644 --- a/build/tms570_hydctr/Release/GNUmakefile +++ b/build/tms570_hydctr/Release/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 0 include ../../Makefile.lib.inc - -RPP_CFLAGS += -O2 diff --git a/build/tms570_rpp/Debug/GNUmakefile b/build/tms570_rpp/Debug/GNUmakefile index 6d47e9e..4f85678 100644 --- a/build/tms570_rpp/Debug/GNUmakefile +++ b/build/tms570_rpp/Debug/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 1 include ../../Makefile.lib.inc - -RPP_CFLAGS += -g -O0 diff --git a/build/tms570_rpp/Release/GNUmakefile b/build/tms570_rpp/Release/GNUmakefile index 16367b2..8f2db8b 100644 --- a/build/tms570_rpp/Release/GNUmakefile +++ b/build/tms570_rpp/Release/GNUmakefile @@ -1,3 +1,2 @@ +rpp_lib_DEBUG = 0 include ../../Makefile.lib.inc - -RPP_CFLAGS += -O2 -- 2.39.2