2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 07:11:32 +00:00

Allow truly arbitrary debug levels to be specified via DEBUG=

This commit is contained in:
Michael Brown 2007-01-18 19:00:09 +00:00
parent 5d57cd47a2
commit 37f1b12587
2 changed files with 4 additions and 4 deletions

View File

@ -116,8 +116,7 @@ $(BIN)/%.flags :
#
COMPILE_c = $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
RULE_c = $(COMPILE_c) -c $< -o $@
RULE_c_to_dbg.o = $(COMPILE_c) -Ddebug_$(OBJECT) -c $< -o $@
RULE_c_to_dbg2.o = $(COMPILE_c) -Ddebug_$(OBJECT)=2 -c $< -o $@
RULE_c_to_dbg%.o = $(COMPILE_c) -Ddebug_$(OBJECT)=$* -c $< -o $@
RULE_c_to_c = $(COMPILE_c) -E -c $< > $@
RULE_c_to_s = $(COMPILE_c) -S -g0 -c $< -o $@
@ -126,7 +125,7 @@ ASSEMBLE_S = $(AS) $(ASFLAGS)
RULE_S = $(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
RULE_S_to_s = $(PREPROCESS_S) $< > $@
DEBUG_TARGETS += dbg2.o dbg.o c s
DEBUG_TARGETS += dbg%.o c s
# SRCDIRS lists all directories containing source files.
#

View File

@ -226,7 +226,8 @@ TGT_MAKEROM_FLAGS = $(strip $(MAKEROM_FLAGS_$(TGT_ROM_NAME)) \
#
COMMA := ,
DEBUG_LIST = $(subst $(COMMA), ,$(DEBUG))
DEBUG_OBJ_BASE = $(word 1,$(subst :, ,$(1))).dbg$(word 2,$(subst :, ,$(1)))
DEBUG_OBJ_LEVEL = $(firstword $(word 2,$(subst :, ,$(1))) 1)
DEBUG_OBJ_BASE = $(word 1,$(subst :, ,$(1))).dbg$(call DEBUG_OBJ_LEVEL,$(1))
DEBUG_OBJ = $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
DEBUG_ORIG_OBJ = $(BIN)/$(word 1,$(subst :, ,$(1))).o
DEBUG_OBJS = $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))