How to define a macro in a makefile for enabling a feature in a C header?
I wan开发者_Go百科t to define a macro in one of the header files. Can I set it through a makefile?
For example, I want to set a macro "PAGING_ON" which I want to be a preprocessor macro for source files. (The project is in C.) Is it possible to set it through the Makefile?
Most of the compilers I know about have this option; for example, you can use compilation flag -D
in gcc (-DPAGING_ON
)
For Visual C (and variants) it is /D
精彩评论