Is it possible to define a C macro in a makefile?

前端 未结 3 1500
情话喂你
情话喂你 2020-12-09 15:57

Is it possible to put the equivalent of #define VAR (in a C program) into a makefile, so that one can control which part of the program should be compiled?

3条回答
  •  鱼传尺愫
    2020-12-09 16:56

    Yes.

    Most compilers support command line options for specifying #define's. For Visual C++, this is the /D option.

提交回复
热议问题