Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Inferring include paths and make targets from existing Makefile in Eclipse

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:

  • Which toolchain should I choose? and how does Eclipse use this information?
  • I would like Eclipse to infer as much as it can from the top-level Makefile (e.g. include paths, make targets, etc) . How can I do this?
like image 832
Amelio Vazquez-Reina Avatar asked Oct 10 '12 19:10

Amelio Vazquez-Reina


1 Answers

Your question is very similar to what I have setup for my project.

  1. If the target platform that the application is expected to run on is the machine you are compiling on, the you ought to select Linux GCC.
  2. If the target platform that application will run on is eg an ARM processor, you need to specify cross GCC.
  3. The GNU Autotools Toolchain is designed to build source-code packages on different linux systems.

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.

like image 58
bobestm Avatar answered Oct 11 '22 12:10

bobestm