11
votes

For my C++ build process, I am using Bakefile, a nice little Makefile generator, which lets you specify your build targets in XML, and it can generate various Makefiles or project files from it. It works fine and I use it to generate the GNU autotools scripts.

Now I heard of Premake, which seems to have a similar functionality. You specify your targets in Lua, and it generates Makefiles accordingly.

Does anyone know the differences between Bakefile and Premake? Does anyone have experience with both? Premake seems more recent and with more active development?

The XML parser ticpp uses Premake, but it requires you to download premake before you build ticpp. Can't they just pre-generate Makefiles for various systems so you don't have to download and install premake first?

Note: I know there are various SO threads about what the best build tool is, and usually the answer is CMake, SCons or Jam. However, I am interested in something that my users won't have to download before they build my project.

3
> However, I am interested in something that my users won't have to download before they build my project. Scons and Cmake (not sure about Jam) also generate Makefiles.amit kumar
But, do they generate the whole autotools mess? Just generating a Makefile is not enough. Also, I think with CMake and friends you can generate a Makefile for a certain system only if you are on such a system.Frank
waf code.google.com/p/waf is designed to be small enough you add it to your ptoject so not a separate download.mmmmmm

3 Answers

11
votes

Not exactly an answer, but I whole-heartedly recommend premake4, it's fantastic.

9
votes

Yes, Premake does allow you to generate a Makefile (or Visual Studio solution, or...) which you can then distribute, if you want. Premake itself includes pre-generated makefiles in its source packages.

Downloading and running Premake on the target machine allows the makefile to be customized, either by automated analysis of the system, or manually via command-line flags. For some projects that's a worthwhile trade-off, but it isn't required.

2
votes

After using both Premake 4 and the new version of Bakefile, it seems that they target different use cases.

  • Bakefile is oriented towards what you want: generate the build files locally and then distribute your project with them. I have had great experience with this tool.
  • Premake is more like CMake: local makefile generation. Sometimes, you have lots of fancy configs that need to be run on the target machine. Bakefile lets you accomplish this using plugins, but it can get messy fast. However, you can pre-generate files.

For your usage, I'd recommend Bakefile. Sounds like you don't need anything fancy.