tags:

views:

130

answers:

5

I am working on a legacy C app which uses makefiles. I am more comfortable (and more productive) working from within an IDE, so I am looking for an IDE that can import the makefile and create a project.

Incidentally, these are hand written makefiles (not complicated ones like those generated by Autoconf). I am using Code::Blocks at the moment, but it seems it is unable to import makefiles ...

+1  A: 

I think that most do. For a fact QTCreator and Eclipse can deal with makefile based projects appropriatedly.

In eclipse CDT (last one I have used) just create a C++ project specifying the current location of your project and tell it to use an empty makefile. That will create an Eclipse project that uses the existing makefile (untouched)

David Rodríguez - dribeas
A: 

Unless you make some hard assumptions on what can and cannot happen in the make file, I doubt what you describe is even theoretically possible.

shoosh
+2  A: 

The last time I checked, Eclipse can import makefile projects or generate makefiles for you.

Xavier Ho
+1 for the suggestion, but you have it the wrong way round: Eclipse can import already-existing Makefile-based projects too.
rq
Ah yes, fixed that. Thanks!
Xavier Ho
A: 

The best you can do is buildint makefile base projects. if you do it that way however YOU are responsible to keep this makefile up to date. And this can makefile is the usually way it is done in Linux IDES, the IDES generate the Makefile but the otherway generating Projects from Makefile is not supporte.

Friedrich
best ? how do you quantify that. There are better ways these days.
Hassan Syed
best to integrate makefiles of course there may be better ways. But the OP wants to have a project generated from a Makefile and AFAIKT this option is not offered anywhere.
Friedrich
A: 

The autotools chain is quite a patchwork system -- there isn't enough structure in the toolchain for an IDE to "import" the project consitantly and correctly. However, some IDE's (e.g., eclipse and netbeans) can import them, provided the build script follow certain popular conventions.

If you want to work with code in the most robust manner (cross platform, cross IDE etc) I would find a set of tools that are designed to be portable.

So, what I am driving at is that you need a robust build system. A robust build system would compile the same code base on any OS/IDE. In order to achieve this you need to be able to specify your build needs at yet a higher level of abstraction. Tools exist to do this, and in the C/C++ world CMAKE is the popular choice. Once you have written a CMAKE description of your project you can target any IDE.

Hassan Syed
Ah yes, I had forgotten about CMAKE. I think I will use CMAKE. However, I need to be able to be able to navigate from an error to the file in which the error occured (for compilation errors) - and for that I will need an IDE ... am I missing something?
Paul
Well if you get cmake to generate IDE projects then the IDE can parse the strings. Emacs and Vim can parse error strings. I personally use a bash window and read the error strings myself :D
Hassan Syed