Author Topic: Import makefile to project  (Read 23782 times)

Offline rickyviking

  • Single posting newcomer
  • *
  • Posts: 3
Import makefile to project
« on: October 17, 2006, 12:16:08 am »
Hi All,

also referring to this post
http://forums.codeblocks.org/index.php?topic=1020.0
I'd like to know if it's now possible to import a makefile and create a CodeBlocks project from that.

That' because I'd like to take a glance/try to contribute to some opensource projects that come only with configure/makefile.
As I'm not a makefile expert at all, it's very difficult to understand from it the structure, dependencies etc of the project, and a nice import into CB would be great.

Any hints?

thanks_ricky

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9611
Re: Import makefile to project
« Reply #1 on: October 17, 2006, 08:31:24 am »
Any hints?
I think it would be pure magic if someone did this. But honestly: Importing Makefiles cannot be done easily. I am not aware that there is *any* importer for Makefiles out there... not only for C::B. Sorry.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline rickyviking

  • Single posting newcomer
  • *
  • Posts: 3
Re: Import makefile to project
« Reply #2 on: October 17, 2006, 09:15:14 pm »
I think it would be pure magic if someone did this. [...]

Ok,

thanks Morten for taking my feet back to the ground... =)

To go back to human options: the easiest way to understand something about a makefile is trying to make it? Other suggestions for a newbye?
Once I understand how the project should be built, should I create a new CB project, import the files, and use the makefile as build options?

thanks,
Ricky





Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9611
Re: Import makefile to project
« Reply #3 on: October 17, 2006, 10:29:39 pm »
To go back to human options: the easiest way to understand something about a makefile is trying to make it? Other suggestions for a newbye?
This isn't easy - in fact I have ported quite some Makefile projectw to C::B. Some of them used autobuild before (you know.... this configure stuff) which produces Makefiles too complex to easily understand. Here (from my point of view) you have two options: Eigther you understand the setup in the configure.in and the autobuild Makefiles (Makefile.am) or (what I did) you do the configure, then do the compilation and pipe the ouput into a file. Then you can analyse the file what compiler/linker parameters had been used. I did this successful for quite some library/application projects. But there are also some (e.g. wxWidgets) where I didn't succeed so far...
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline nova

  • Single posting newcomer
  • *
  • Posts: 5
Re: Import makefile to project
« Reply #4 on: October 23, 2006, 06:42:30 am »
Hi Ricky!

I suggest using the makefile generated from ./configure as a 'custom makefile' within codeblocks.

make sure to add in all the required files to the project via 'add files recursively', this is easy enough as CB excludes non-standard source code file extensions from being imported. (.cpp would be included while .cuu would be excluded)

if you're using mingw+msys, then you may need to use the -C option to fix problems with sh.exe not finding sed, or similar problems.  It's not preferable to add msys/bin to your path.
eg: $make -C j:\src\hwsdl -f $makefile

if you have problems debugging using GDB (if you use it) ask us here about it, as you may need to use absolute paths in your project file, instead of relative paths.

nova
« Last Edit: October 24, 2006, 01:33:14 am by nova »

Offline rickyviking

  • Single posting newcomer
  • *
  • Posts: 3
Re: Import makefile to project
« Reply #5 on: October 23, 2006, 10:31:11 am »
Thanks a lot guys, I'll give that a try!

Ricky

Offline nova

  • Single posting newcomer
  • *
  • Posts: 5
Re: Import makefile to project
« Reply #6 on: October 24, 2006, 02:22:33 am »
i forgot something,  if you're compiling with mingw+msys (but using msys's make.exe) and sed (or whatever) can't be found, i suggest you just add msys's bin dir to "additional paths" inside codeblocks.