The C preprocessor phase will only pass the code inside #ifdef/#endif to the compiler phase if the character is defined.
You can usually do this (at least) in two ways.
First, use the command line switch for the command line, for example:
gcc -DDEBUG_MSG myprog.c
( -D means that a preprocessor character should be defined after it, and although this is implementation specific, many compilers use the same switch). The second is to place the line, for example:
#define DEBUG_MSG
inside your source code somewhere up to #ifdef .
The first rule is preferable because it allows you to control this behavior without the need to make changes to the source code, so that, for example, you can create a debug and release assembly generated from the same source code.
source share