sfjac
sfjac

Reputation: 7284

Eclipse CDT and Makefile.release / Makefile.debug

Our build system produces Makefile.release and Makefile.debug files for release and debug builds. Is there a way to get Eclipse CDT to switch between these when I change build configurations? (Or to change the name in any case?) I'm manually making links to Makefile right now, but that's not a good solution.

Upvotes: 2

Views: 516

Answers (1)

PeterSW
PeterSW

Reputation: 5261

That's quite easy to setup. I'm assuming your project in eclipse is set-up as a C/C++ Makefile project.

First open up the properties for the project. Which you can do by selecting the project in the Project Explorer and then selecting from the Menu bar: Project -> Properties.

Then you can navigate to C/C++ Build within the dialog. Where you should see something similar to below:

enter image description here

You then need to un-tick "Use default build command" and "Generate Mafefiles automatically". You can then enter the command make -f Makefile.debug in the "Build command" field.

Once you are done it should look like as shown in the screen-shot.

You can then switch to the Release configuration using the "Configuration" drop-down adding it in "Manage Configurations..." if required and apply the same steps.

You may need to adjust some of the settings in the "Behavior" tab if targets assumed there don't match your project.

Upvotes: 1

Related Questions