Browse Source

Allow truly arbitrary debug levels to be specified via DEBUG=

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
37f1b12587
2 changed files with 4 additions and 4 deletions
  1. 2
    3
      src/Makefile
  2. 2
    1
      src/Makefile.housekeeping

+ 2
- 3
src/Makefile View File

116
 #
116
 #
117
 COMPILE_c	= $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
117
 COMPILE_c	= $(CC) $(CFLAGS) $(CFLAGS_c) $(OBJ_CFLAGS)
118
 RULE_c		= $(COMPILE_c) -c $< -o $@
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
 RULE_c_to_c	= $(COMPILE_c) -E -c $< > $@
120
 RULE_c_to_c	= $(COMPILE_c) -E -c $< > $@
122
 RULE_c_to_s	= $(COMPILE_c) -S -g0 -c $< -o $@ 
121
 RULE_c_to_s	= $(COMPILE_c) -S -g0 -c $< -o $@ 
123
 
122
 
126
 RULE_S		= $(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
125
 RULE_S		= $(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
127
 RULE_S_to_s	= $(PREPROCESS_S) $< > $@
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
 # SRCDIRS lists all directories containing source files.
130
 # SRCDIRS lists all directories containing source files.
132
 #
131
 #

+ 2
- 1
src/Makefile.housekeeping View File

226
 #
226
 #
227
 COMMA		:= ,
227
 COMMA		:= ,
228
 DEBUG_LIST	= $(subst $(COMMA), ,$(DEBUG))
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
 DEBUG_OBJ	= $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
231
 DEBUG_OBJ	= $(BIN)/$(call DEBUG_OBJ_BASE,$(1)).o
231
 DEBUG_ORIG_OBJ	= $(BIN)/$(word 1,$(subst :, ,$(1))).o
232
 DEBUG_ORIG_OBJ	= $(BIN)/$(word 1,$(subst :, ,$(1))).o
232
 DEBUG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))
233
 DEBUG_OBJS	= $(foreach D,$(DEBUG_LIST),$(call DEBUG_OBJ,$(D)))

Loading…
Cancel
Save