Using custom Makefile with Eclipse/CDT

Stoiko picture Stoiko · Dec 8, 2009 · Viewed 87.3k times · Source

I have a project of multiple .c and .h files and I write my own makefile.

How can I configure Eclipse to use my makefile and my source files from their original locations?

Answer

nates picture nates · Nov 12, 2011

You can create a custom Makefile and make sure it's in your project root. Then you need to disable the auto generated makefiles. You can do that by going here:

Project Properties (right click on project and select properties) -> C/C++ Build -> in that window uncheck "Generate Makefiles Automatically."

To use your own targets you can open the View called "Make Target":

Window -> Show View -> Make Target

In that view you can create a new target that will use the corresponding target in your custom Makefile.