Reputation: 96294
I am trying to use Eclipse on an existing collection of folders with C++ and recursive Makefile files in Linux. The make
files use gcc
and ar
, and the user specifies the path to the gcc
he wants to use in the Makefile. The make files that I will be working with were typed by hand.
In Eclipse, there is an option to create a new project that looks appropriate for what I need: "Create a new Makefile project from existing code in that same directory"
.
* <none>
* cross GCC
* GNU Autotools Toolchain
* Linux GCC
Here I have two questions:
Upvotes: 6
Views: 2695
Reputation: 1334
Your question is very similar to what I have setup for my project.
By selecting "Create a new Makefile project from existing code in that same directory" eclipse will assume that the user's makefiles will manage the build itself. For eclipse to infer include paths, have the discovery options enabled in the project settings. Admittedly, your top-level make needs to specify include path, source-code paths etc.
Upvotes: 3
Reputation: 908
You really can only eiter allow Eclipse to create the makefile for you based on what you have in your project or tell it which command to run when you select 'build'. Mixing these options I have found doesn't really work. If you are specifying the Makefile then the compiler used doesn't really matter either since the Makefile will define that. Just pick an 'empty c++ project' when you create a new project, make sure you specify not to use the 'default workspace' location and point this input box to your code base instead. In the project c++/build settings make sure that the "automatically generate makefile" is unchecked and specify what command should be executed to make your project. (usually this is 'make all' but it might be different for you)
Upvotes: 1