Ver código fonte

[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 anos atrás
pai
commit
3f13e3d5d2
2 arquivos alterados com 7 adições e 6 exclusões
  1. 1
    0
      src/Makefile.housekeeping
  2. 6
    6
      src/include/compiler.h

+ 1
- 0
src/Makefile.housekeeping Ver arquivo

@@ -470,6 +470,7 @@ RULE_c_to_s	= $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
470 470
 PREPROCESS_S	= $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
471 471
 ASSEMBLE_S	= $(AS) $(ASFLAGS)
472 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 474
 RULE_S_to_s	= $(Q)$(PREPROCESS_S) $< > $@
474 475
 
475 476
 DEBUG_TARGETS	+= dbg%.o c s

+ 6
- 6
src/include/compiler.h Ver arquivo

@@ -204,7 +204,6 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
204 204
 /** @defgroup dbg Debugging infrastructure
205 205
  * @{
206 206
  */
207
-#ifndef ASSEMBLY
208 207
 
209 208
 /** @def DBG
210 209
  *
@@ -255,6 +254,12 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
255 254
  */
256 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 263
 /** printf() for debugging
259 264
  *
260 265
  * This function exists so that the DBG() macros can expand to
@@ -544,11 +549,6 @@ int __debug_disable;
544 549
 #define DBGCIO_PAUSE( ... )	DBGC_PAUSE_IF	( IO, ##__VA_ARGS__ )
545 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 552
 #endif /* ASSEMBLY */
553 553
 /** @} */
554 554
 

Carregando…
Cancelar
Salvar