From 263375c3a4726f1b3d503a9d7d2be3fea9d38246 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 21 Oct 2015 11:57:39 -0400 Subject: maker.org make setting debug flags more straightforward --- makefile | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index d8bee00..6f9b746 100644 --- a/makefile +++ b/makefile @@ -15,27 +15,29 @@ GDC_FLAGS_RELEASE=-frelease GDC_FLAG_BINOF=-o # set D_COMPILER one of DMD LDC or GDC: -D_COMPILER=LDC +SET_D_COMPILER=LDC -SET_DC_FLAGS_DEBUG=-unittest -debug=checkdoc -debug=summary SET_DC_FLAGS_DEBUG_EXTRA=-debug=headings -debug=bookindex -DC=$($(D_COMPILER)) -DC_FLAGS=$($(shell echo $(D_COMPILER)_FLAGS)) -DC_FLAGS_RELEASE=$($(shell echo $(D_COMPILER)_FLAGS_RELEASE)) -DC_FLAG_BINOF=$($(shell echo $(D_COMPILER)_FLAG_BINOF)) +DC=$($(SET_D_COMPILER)) +DC_FLAGS=$($(shell echo $(SET_D_COMPILER)_FLAGS)) +DC_FLAGS_RELEASE=$($(shell echo $(SET_D_COMPILER)_FLAGS_RELEASE)) +DC_FLAG_BINOF=$($(shell echo $(SET_D_COMPILER)_FLAG_BINOF)) +#DC_FLAGS=$($(shell echo $(DC)_FLAGS)) +#DC_FLAGS_RELEASE=$($(shell echo $(DC)_FLAGS_RELEASE)) +#DC_FLAG_BINOF=$($(shell echo $(DC)_FLAG_BINOF)) +DC_FLAGS_DEBUG_DEFAULT_SET=-unittest -debug=checkdoc -debug=summary +DC_FLAGS_DEBUG_SET=\ + $(shell echo $(DC_FLAGS_DEBUG_DEFAULT_SET) $(SET_DC_FLAGS_DEBUG_EXTRA)) ifeq ($(DC), $(DMD)) - DC_FLAGS_DEBUG :=$(shell echo $(SET_DC_FLAGS_DEBUG)) - DC_FLAGS_DEBUG_EXTRA :=$(shell echo $(SET_DC_FLAGS_DEBUG_EXTRA)) + DC_FLAGS_DEBUG :=$(shell echo $(DC_FLAGS_DEBUG_SET)) endif ifeq ($(DC) ,$(LDC)) - DC_FLAGS_DEBUG :=$(shell echo $(SET_DC_FLAGS_DEBUG)| sed -e "s/-debug=/-d-debug=/g") - DC_FLAGS_DEBUG_EXTRA :=$(shell echo $(SET_DC_FLAGS_DEBUG_EXTRA)| sed -e "s/-debug=/-d-debug=/g") + DC_FLAGS_DEBUG :=$(shell echo $(DC_FLAGS_DEBUG_SET)| sed -e "s/-debug=/-d-debug=/g") endif ifeq ($(DC), $(GDC)) - DC_FLAGS_DEBUG :=$(shell echo $(SET_DC_FLAGS_DEBUG)| sed -e "s/-debug/-fdebug/g") - DC_FLAGS_DEBUG_EXTRA :=$(shell echo $(SET_DC_FLAGS_DEBUG_EXTRA)| sed -e "s/-debug/-fdebug/g") + DC_FLAGS_DEBUG :=$(shell echo $(DC_FLAGS_DEBUG_SET)| sed -e "s/-debug/-fdebug/g") endif PRG_NAME=sdp @@ -62,22 +64,22 @@ build: $(PRG_SRCDIR)/$(PRG_SRC) rebuild: $(PRG_SRCDIR)/$(PRG_SRC) $(PRG_BINDIR)/$(PRG_BIN).o clean build debug: $(PRG_SRCDIR)/$(PRG_SRC) - $(DC) $(DC_FLAGS) $(DC_FLAGS_DEBUG) $(DC_FLAGS_DEBUG_EXTRA) \ + $(DC) $(DC_FLAGS) $(DC_FLAGS_DEBUG) \ $(DC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) debug_dmd: $(PRG_SRCDIR)/$(PRG_SRC) - $(DMD) $(DMD_FLAGS) $(DMD_FLAGS_DEBUG) $(DC_FLAGS_DEBUG_EXTRA) \ + $(DMD) $(DMD_FLAGS) $(DMD_FLAGS_DEBUG) \ $(DMD_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) debug_ldc: $(PRG_SRCDIR)/$(PRG_SRC) - $(LDC) $(LDC_FLAGS) $(LDC_FLAGS_DEBUG) $(DC_FLAGS_DEBUG_EXTRA) \ + $(LDC) $(LDC_FLAGS) $(LDC_FLAGS_DEBUG) \ $(LDC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) debug_gdc: $(PRG_SRCDIR)/$(PRG_SRC) - $(GDC) $(GDC_FLAGS) $(GDC_FLAGS_DEBUG) $(DC_FLAGS_DEBUG_EXTRA) \ + $(GDC) $(GDC_FLAGS) $(GDC_FLAGS_DEBUG) \ $(GDC_FLAG_BINOF)$(PRG_BINDIR)/$(PRG_BIN) \ $(PRG_SRCDIR)/$(PRG_SRC) -- cgit v1.2.3