Author Topic: Automatic makefile generation  (Read 4553 times)

RhysBJ

  • Guest
Automatic makefile generation
« on: June 24, 2006, 10:23:13 pm »
I can't find how to get Code::Blocks to automatically generate a makefile. I've looked at the faq and it has a section about using custom make files. I tried to follow the first part of this, without enabling custom makefiles but the Build Method combo box is locked in the compiler settings.
I've also searched the forum for similar topics, and the only one that seemed relevent said to use Build->Export makefile. I do not have this option.
I'm using the June 15 build from this year.

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Automatic makefile generation
« Reply #1 on: June 24, 2006, 11:26:23 pm »
Hello,

AFAIK, there will not be automatic makefile generation.

Try to search in the forum. I am sure you will find some useful posts.

[EDIT]Also look under: Project-->Properties-->Project

Best wishes,
Michael
« Last Edit: June 24, 2006, 11:28:43 pm by Michael »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Automatic makefile generation
« Reply #2 on: June 25, 2006, 01:08:23 pm »
There was a function "export makefile" a long time ago, but it was sacked for being utterly broken and making more problems that it was good for.

There are currently no plans to reimplement this feature (although that does not mean we will never possibly do so).

If you can live with a makefile that has all its paths hardcoded, you can pretty much make your own makefile exporter rather easily, since you can query everything you need from the compiler plugin. The build process does not do things a lot differently, it asks for all files first, and then asks for a valid set of compiler options for each file.
If you get all files belonging to one target and get the compiler options for one of them, then you should only need to stream all of that to a text file, and you're done (more or less).

However, be warned that the compiler system is being worked over, so the API may change in the future.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."