How to import C makefile project into eclipse or put in under eclipse

58,698

Solution 1

First run the ./configure to generate the Makefile. After that, if you have CDT installed,just choose the option "File->New->Makefile Project With Existing Code" and point to the directory where the Makefile is stored.

Solution 2

Create a new project, make sure to uncheck the "Use default location" option while doing so. Add your source tree path in the location field. Now select "Makefile Project" in the project types window.

In "builder settings" (Project>Properties), uncheck the "use default build command" and add:

make -f /<your project location/Makefile

If your makefile is named otherwise, you can change it here.

To run your application, add the application in Run Configurations. See full instructions here.

Solution 3

Don't say import.

Create a new C/C++ project using the New Project Wizard, and specify the "root folder" as a non-default location of the new project.

See the instructions here.

Read "Creating new projects from existing source roots"

Share:
58,698

Related videos on Youtube

Dims
Author by

Dims

Software developer &amp; Machine Learning engineer C/C++/Java/C#/Python/Mathematica/MATLAB/Kotlin/R/PHP/JavaScript/SQL/HTML/ LinkedIn: http://www.linkedin.com/in/dimskraft Telegram: https://t.me/dims12 I prefer fishing rod over fish.

Updated on July 04, 2020

Comments

  • Dims
    Dims almost 4 years

    I have standard source code package under Linux which requires to run

    ./configure
    make
    

    to compile it (and it works ok).

    Mostly these files are C/C++

    Is it possible to put this project under Eclipse control? I wish to browse definitions etc...

    UPDATE 1

    I have Eclipse Indigo running on Ubuntu. It contains CDT of course.

    When I choose File-Import, I see no matching option under C/C++. Under General I have Existing Projects into Workspace but I get No project are found to import if I point this wizard to my project root.

    UPDATE 2

    I have installed Eclipse with Ubuntu package manager. Probably this was wrong.

  • Dims
    Dims about 12 years
    I have no File->New->Makefile Project With Existing Code option. Probably I need to install Eclipse not with Ubuntu package manager.
  • manasij7479
    manasij7479 about 12 years
    Try File->New->Other-> Makefile Project with Existing Code. Install CDT if you already haven't.
  • gfan
    gfan over 5 years
    Is it ok to do Import ->C/C++ -> Existing code as AutoTools project ? Let eclipse run the ./configure ?
  • gfan
    gfan over 5 years
    I download a Binutils tar package, I extract it to folder binutils. The Binutils documentation recommends building Binutils in a dedicated build directory, so I mkdir binutils/build, I run configure and get a Makefile in binutils/build. Then I File->New->Makefile Project With Existing Code and point to the directory where the Makefile is stored. But how to add the source code ?
  • gfan
    gfan over 5 years
    When all settings are done, run project/build project from the menu in Eclipse, building is processing, how to redirect the output to the Eclipse's console?
  • gfan
    gfan over 5 years
    When all settings are done, run project/build project from the menu in Eclipse, building is processing, how to redirect the output to the Eclipse's console?