Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-12-03 04:44:16


On Friday 03 December 2004 12:27, David Abrahams wrote:
> Vladimir Prus wrote:
> > On Friday 03 December 2004 11:47, David Abrahams wrote:
> >>Vladimir Prus wrote:
> >> > Obviously, there should be an invocation of main target rule. You can
> >> > either define it yourself (like boostbook.jam defined the 'boostbook'
> >> > rule, or let V2 do it for you:
> >> >
> >> > http://boost.org/boost-build2/doc/html/bbv2/extending/rules.html
> >> >
> >> > (Look for "the second approach" phrase).
> >>
> >>It says:
> >>
> >> if you create a module "obfuscate.jam" containing:
> >>
> >> import type ;
> >> type.register OBFUSCATED_CPP : ocpp : : main ;
> >>
> >> import generators ;
> >> generators.register-standard obfuscate.file : CPP : OBFUSCATED_CPP ;
> >>
> >> and import that module, you'll be able to use the rule
> >> "obfuscated-cpp" in Jamfiles, which will convert source to the
> >> OBFUSCATED_CPP type.
> >>
> >>Really? Where would that rule come from? Don't you mean "ocpp?"
> >
> > No, the name of the rule is derived from the name of target type
> > (OBFUSCATED_CPP), not from extension (ocpp). The target type is downcased
> > and then underscores are replaced with dashes. Which gives
> > 'obfuscated-cpp'. I already forgot why target types are in uppercase :-(
>
> Well, that was really non-obvious. I think it needs to be documented
> there.

Sure. I'll do it as soon as I implement "a main rule for each new type" logic.

> You should also explain the role of "ocpp" there. What does it
> mean?

It's the suffix for the type. This is more or less documented at

http://boost.org/boost-build2/doc/html/bbv2/extending/targets.html

but I guess a link won't hurt.

- Volodya

 


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