Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specifying external Makefile options in Eclipse CDT

I'd like to (temporarily) migrate a C++ project from Netbeans to Eclipse (in order to use Eclipse's parallel debugger). So far I've created a "Makefile project with Existing Code" project in Eclipse that references the Netbeans project Makefile/directory. However the Netbeans project accepts config options for example

make -f Makefile CONF=GNU_Debug

How can I pass this option to the Makefile in Eclipse?

Eclipse version Eclipse for Parallel Application Developers -- Mars.2 Release (4.5.2)

like image 843
Olumide Avatar asked Jul 16 '16 15:07

Olumide


2 Answers

You can change the default make call in the projects properties dialog:

enter image description here

My version:

Version: Mars.1 Release (4.5.1)


Note that the -f Makefile should be superfluous.

like image 80
πάντα ῥεῖ Avatar answered Sep 20 '22 20:09

πάντα ῥεῖ


In addition to πάντα ῥεῖ's answer, which changes settings "globally" for a project, you can define individual make targets in the Make Target view.

Steps:

  1. Choose Window -> Show View -> Other... -> Make -> Make Target (or simpler, press Ctrl+3 then type Make Target and choose the view from the list.)
  2. Right click on the project in the view and choose New...
  3. Enter the make target you want to use, e.g. CONF=GNU_Debug and press OK
  4. Double-click on target to build

Here is a screenshot:

enter image description here

Shortcuts

  • You can quickly rebuild last selected Make target by pressing F9
  • Bring up a pop-up to select Make target by pressing Shift+F9
  • Access the same UI as above by right-clicking on project in Project Explorer and choosing Make Targets -> Build or selecting the same from the Project menu.
like image 28
Jonah Graham Avatar answered Sep 21 '22 20:09

Jonah Graham