[Rant-cafe] SCons like targets
Russel Winder
russel at russel.org.uk
Wed Dec 6 19:12:08 EST 2006
On Wed, 2006-12-06 at 09:54 -0800, Dean Kassmann wrote:
> Ok, I'll bite and try my hand at a generator for c++. Do you recommend
> that I start with cs_compiler.rb as a template or rather start from
> scratch using something like Command as a template.
I don't know enough about C# to say whether it is a good match for a C++
build or not. Sorry, a bit of a cop out that.
I started from scratch for the LaTeX generator and decided on a
structure:
gen LaTeX, <source-file-name> [ , <optional-parameter-hash> ]
so I can do things like:L
target = gen LaTeX , 'document.ltx'
which generates document.pdf and all the rules to delete all the
generated files if "import 'clean'" or "import 'autoclean'" appear
before hand. Alternatively:
target = gen LaTeX , 'document.ltx' , { 'generate' => 'PostScript' }
generates a PostScript file and all the clean rules. I guess my
message is decide what the generator call should have as parameters to
deal with the model of build and then think how to implement the class.
The main issue is, I think, whether the system should parse the files to
ascertain the dependency tree (as SCons does) or whether the dependency
tree should be provided manually. For LaTeX this is a very deep and
non-trivial question because it is a macro processing language. For C++
it is a lot easier since #include is the only way of creating explicit
dependency.
So the base can perhaps be:
gen Cpp , main.cpp
which generates a.out ( or whatever on Windoze).
PS I am happy to try things on my GFontBrowser project which is a C
++/fontconfig/pango project for which I have Autoconf, CMake, SCons,
Waf, and Rant build systems.
--
Russel.
====================================================
Dr Russel Winder +44 20 7585 2200
41 Buckmaster Road +44 7770 465 077
London SW11 1EN, UK russel at russel.org.uk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://rubyforge.org/pipermail/rant-cafe/attachments/20061207/b86e72bd/attachment.bin
More information about the Rant-cafe
mailing list