]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[build] Allow DEBUG=... to affect builds of assembler source files
authorMichael Brown <mcb30@ipxe.org>
Tue, 1 Mar 2011 14:18:35 +0000 (14:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 1 Mar 2011 14:18:35 +0000 (14:18 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/Makefile.housekeeping
src/include/compiler.h

index 0570f018a30afa2f6f3900746e1bd57337527d5a..c7a54341bda1d5e91a318d2706f84911f0a209ff 100644 (file)
@@ -470,6 +470,7 @@ RULE_c_to_s = $(Q)$(COMPILE_c) -S -g0 -c $< -o $@
 PREPROCESS_S   = $(CPP) $(CFLAGS) $(CFLAGS_S) $(OBJ_CFLAGS)
 ASSEMBLE_S     = $(AS) $(ASFLAGS)
 RULE_S         = $(Q)$(PREPROCESS_S) $< | $(ASSEMBLE_S) -o $@
+RULE_S_to_dbg%.o = $(Q)$(PREPROCESS_S) -Ddebug_$(subst -,_,$(OBJECT))=$* $< | $(ASSEMBLE_S) -o $@
 RULE_S_to_s    = $(Q)$(PREPROCESS_S) $< > $@
 
 DEBUG_TARGETS  += dbg%.o c s
index f1bd0e4d25e880417605e90f0f6d8a00814f6fc7..feea5167ec04113e76ba0cd38282ff416fd84b01 100644 (file)
@@ -204,7 +204,6 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
 /** @defgroup dbg Debugging infrastructure
  * @{
  */
-#ifndef ASSEMBLY
 
 /** @def DBG
  *
@@ -255,6 +254,12 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
  */
 #define DEBUG_SYMBOL PREFIX_OBJECT ( debug_ )
 
+#if DEBUG_SYMBOL == 0
+#define NDEBUG
+#endif
+
+#ifndef ASSEMBLY
+
 /** printf() for debugging
  *
  * This function exists so that the DBG() macros can expand to
@@ -544,11 +549,6 @@ int __debug_disable;
 #define DBGCIO_PAUSE( ... )    DBGC_PAUSE_IF   ( IO, ##__VA_ARGS__ )
 #define DBGCIO_MORE( ... )     DBGC_MORE_IF    ( IO, ##__VA_ARGS__ )
 
-
-#if DEBUG_SYMBOL == 0
-#define NDEBUG
-#endif
-
 #endif /* ASSEMBLY */
 /** @} */