|
Boost-Build : |
From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-12-19 12:47:20
>Hello, can anybody please give me some help on how to set up some jam rules
>for
>running gob files through the gob preprocessor? Files with the suffix
>".gob"
>will, upon being run through the gob command, produce corresponding ".c"
>and
>".h" files.
Create a file called gob.jam and place it where BBv2 can find it (easiest
place is the build/v2/tools directory).
First, you need to register the gob extension:
import type ;
type.register GOB : gob ;
Here, GOB is a placeholder name for the extension gob. You now need to
register an action to perform on that file:
generators.register-standard gob.gob : GOB : C H ;
Where gob.gob is the file.action to call for this transformation, GOB is the
*source* and C and H are the *targets* to transform to. That is:
GOB --> C H
You now need the action:
actions gob
{
gobpp $(>) $(<[1]) $(<[2])
}
Where gobpp is the gob preprocessor, $(>) is the name of the gob file,
$(<[1]) is the name of the C file and $(<[2]) is the name of the H file.
You can then add
import gob ;
to your user-config.jam file to pull in this. Then
exe myapp : hello.cpp world.gob ;
will compile world.gob using the gobpp.
For more information, have a look at the BoostBuild v2 documentation
(http://www.boost.org/boost-build2) and the various transforming tools (e.g.
lex.jam).
HTH,
Reece
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk