Passing C/C++ #defines to makefile

后端 未结 4 617
一向
一向 2020-12-29 20:31

I develop C/C++ using the Eclipse IDE. Eclipse also generates a makefile which I don\'t want to edit as it will simply be overwritten.

I want to use that makefile fo

4条回答
  •  无人及你
    2020-12-29 20:46

    For GCC use -D define.

    OP commented below that he wants to pass the define into make and have it pass it on to GCC.

    Make does not allow this. Typically you just add another make rule to add defines. For instance 'make release' vs 'make debug'. As the makefile creator you make the two rules and have the defines right in the make file. Now if Eclipse is not putting the defines into the makefile for you, I would say Eclipse is broken.

提交回复
热议问题