开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜