#include<stdio.h>
int main()
{
int i = 9;
#ifdef DEBUG
i=1;
#else
i=0;
#endif
printf("i=%d\n",i);
return 0;
int main()
{
int i = 9;
#ifdef DEBUG
i=1;
#else
i=0;
#endif
printf("i=%d\n",i);
return 0;
}
makefile
CFLAGS=${TEST}
CFLAGS+=-g -Wall
object=test_makefile
all:${object}
test_makefile:test_makefile.c
gcc ${CFLAGS} test_makefile.c -o test_makefile
编译
[vito@localhost interview]$ make TEST=-DDEBUG