Define a pre-processor variable for all the files in make
I have a number of .c and .h files with some parts of the code disabled by putting the code block in pre-processor directives e.g.
#ifdef FOOBAR
// some code that can be compiled if needed by defining FOOBAR in pre-processor.
#endif
No I need to define FOOBAR such that its defined for every file that is compiled by gcc using make.
Is there a way to do this wit开发者_JAVA技巧h some option to make or Makefile ?
Thanks.
Add the compiler option -DFOOBAR to the make variable CFLAGS
加载中,请稍侯......
精彩评论