Using custom Makefile with Eclipse/CDT [duplicate]
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.
There is an option to create a project from existing makefiles: use the "Project Wizard" and select "Makefile project".
You can disable "Generate makefiles automatically" in eclipse project properties -> c/c++ build (builder settings.)