From: <pu...@us...> - 2006-02-01 21:30:01
|
Hi Jason and others, I just recently discovered Lua, and shortly after, Premake. This is a really nice system, I tested the gnu and vs2002 targets on one of my c++ projects and it instantly worked. Thumbs up! I have been looking around for new build systems, make replacements or makefile generators for a while now, and none of them satisfied my needs. I came to the conclusion that what I really needed was not a replacement for make ala scons or jam, but a build-file generator. I rather like to use make for small to medium-size projects, that's not my main issue. But what if I want to load my project into kdevelop or codeblocks? I have to create an emtpy project, configure it to use make, add all files. Tedious. Even worse for my projects where I have to support visual studio and the watcom ide. So something to generate all these build files was needed. I started writing a bash-script to generate all needed build-files, but it wasn't really working out. For using it on a second project, I copied it entirely to the new project-tree and adapted it. But then as I refined and debugged it, the two generator scripts for the two projects diverged and were a hassle to keep in sync. Enter premake. Write one frontend (premake.lua), get all targeted build-scripts. Well, almost all. No support for kdevelop, codeblocks or openwatcom. And I really like to have my makefiles in my own style. And while we're at it, some support for that obscure build tool on that embedded platform would be nice. What I'm getting at is: there's demand for a lot of targets. I browsed around the premake site and found that half of RFEs are for new targets. So in order to make premake really usable for me and probably hugely successful out there, there needs to be an easy way to add backends for new targets. I looked at the source and while it is nicely structured and adding a new target to onCommand() shouldn't be too hard, to me this doesn't seem the way to go, for a number of reasons: * Backends are in the core. To keep up with further premake development, all user-written backends have to be merged with the main core sources at sourceforge. * People will want to modify backends, so that e.g. the generated Makefile looks like their hand-coded one. * Writing backends in plain C is awkward. Why not use a template engine like Velocity, or Lua with Text Template (http://lua-users.org/wiki/TextTemplate)? So what I propose is this: a plugin system for backends. These could be shared libraries or maybe just lua scripts. Everyone can write their own backend generating some build file from premake.lua. Have a plugin directory where all the plugins are located and which premake scans when looking for a backend to generate a given target. Is this feasible? New targets might require new options from premake.lua, as we see now with the compiler selection for c/c++ and .net targets, and with "package.buildaction" for .net. The complexity for supporting lots of targets from a simple premake.lua might be rather large. I would also like to keep premake.lua from turning into a big "if (target)" mess. Not sure if that's possible though. What are your feelings on this? Has something like this been done before? How's the competition doing (e.g. bakefile)? Can other languages like java be easily integrated? So, this turned into a rather lenghy mail. Thanks for your patience :) Greetings, Jens |