瀏覽代碼

Allow truly arbitrary debug levels to be specified via DEBUG=

tags/v0.9.3
Michael Brown 18 年之前
父節點
當前提交
37f1b12587
共有 2 個檔案被更改,包括 4 行新增4 行删除
  1. 2
    3
      src/Makefile
  2. 2
    1
      src/Makefile.housekeeping

+ 2
- 3
src/Makefile 查看文件

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

+ 2
- 1
src/Makefile.housekeeping 查看文件

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

Loading…
取消
儲存