Skip to content

Commit

Permalink
[build] Allow DEBUG=... to affect builds of assembler source files
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Mar 1, 2011
1 parent e583afb commit 3f13e3d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Makefile.housekeeping
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/include/compiler.h
Expand Up @@ -204,7 +204,6 @@ REQUEST_EXPANDED ( CONFIG_SYMBOL );
/** @defgroup dbg Debugging infrastructure
* @{
*/
#ifndef ASSEMBLY

/** @def DBG
*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 */
/** @} */

Expand Down

0 comments on commit 3f13e3d

Please sign in to comment.