Browse Source

[build] Allow DEBUG=... to affect builds of assembler source files

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 13 years ago
parent
commit
3f13e3d5d2
2 changed files with 7 additions and 6 deletions
  1. 1
    0
      src/Makefile.housekeeping
  2. 6
    6
      src/include/compiler.h

+ 1
- 0
src/Makefile.housekeeping View File

470
 PREPROCESS_S	= $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
470
 PREPROCESS_S	= $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
471
 ASSEMBLE_S	= $(AS) $(ASFLAGS)
471
 ASSEMBLE_S	= $(AS) $(ASFLAGS)
472
 RULE_S		= $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
472
 RULE_S		= $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
473
+RULE_S_to_dbg%.o = $(Q)$(PREPROCESS_S) -Ddebug_$(subst -,_,$(OBJECT))=$* $< | $(ASSEMBLE_S) -o $@
473
 RULE_S_to_s	= $(Q)$(PREPROCESS_S) $< > $@
474
 RULE_S_to_s	= $(Q)$(PREPROCESS_S) $< > $@
474
 
475
 
475
 DEBUG_TARGETS	+= dbg%.o c s
476
 DEBUG_TARGETS	+= dbg%.o c s

+ 6
- 6
src/include/compiler.h View File

204
 /** @defgroup dbg Debugging infrastructure
204
 /** @defgroup dbg Debugging infrastructure
205
  * @{
205
  * @{
206
  */
206
  */
207
-#ifndef ASSEMBLY
208
 
207
 
209
 /** @def DBG
208
 /** @def DBG
210
  *
209
  *
255
  */
254
  */
256
 #define DEBUG_SYMBOL PREFIX_OBJECT ( debug_ )
255
 #define DEBUG_SYMBOL PREFIX_OBJECT ( debug_ )
257
 
256
 
257
+#if DEBUG_SYMBOL == 0
258
+#define NDEBUG
259
+#endif
260
+
261
+#ifndef ASSEMBLY
262
+
258
 /** printf() for debugging
263
 /** printf() for debugging
259
  *
264
  *
260
  * This function exists so that the DBG() macros can expand to
265
  * This function exists so that the DBG() macros can expand to
544
 #define DBGCIO_PAUSE( ... )	DBGC_PAUSE_IF	( IO, ##__VA_ARGS__ )
549
 #define DBGCIO_PAUSE( ... )	DBGC_PAUSE_IF	( IO, ##__VA_ARGS__ )
545
 #define DBGCIO_MORE( ... )	DBGC_MORE_IF	( IO, ##__VA_ARGS__ )
550
 #define DBGCIO_MORE( ... )	DBGC_MORE_IF	( IO, ##__VA_ARGS__ )
546
 
551
 
547
-
548
-#if DEBUG_SYMBOL == 0
549
-#define NDEBUG
550
-#endif
551
-
552
 #endif /* ASSEMBLY */
552
 #endif /* ASSEMBLY */
553
 /** @} */
553
 /** @} */
554
 
554
 

Loading…
Cancel
Save