[Omake] scanners not considered valid targets by
"target-is-proper"?
Aleksey Nogin
nogin at metaprl.org
Fri Jan 19 10:03:04 PST 2007
On 19.01.2007 01:50, Erick Tryzelaar wrote:
> I was playing around with target-is-proper, and it appears to not work
> for scanners. Is there a reason for this? Here's a demonstration of the
> problem:
>
> % .SCANNER: baz: bar
[...]
> % echo $(target-is-proper baz)
> false
Note that scanners have a separate namespace - the "Scanner baz" has
nothing to do with the "file baz" (and both are different from the
"phony target baz"). So your test case was asking a wrong question and
getting a correct answer for that question.
Currently, there is no good way of creating a "Scanner" value in OMake
code. I've just committed a change, allowing the "target" and
"dependencies" functions to work on rule values (in a limited way). So
now I can do the following:
% X =
X> X =
X> .SCANNER: baz: bar
rule> echo hi
rule> .
.
X> .
.
- : <rules:
rule {
target = <scanner /home/isl/anogin/SwarmVision/baz>
effects = <scanner /home/isl/anogin/SwarmVision/baz>
locks =
sources = /home/isl/anogin/SwarmVision/bar
scanners =
commands =
{
command_dir = /home/isl/anogin/SwarmVision;
command_sources = /home/isl/anogin/SwarmVision/bar
command_body = "echo hi" : Sequence
}
}>
% Y = $(target $(X))
- : <scanner /home/isl/anogin/SwarmVision/baz> : File
% target-is-proper($Y)
- : <data "true"> : String
Aleksey
More information about the Omake
mailing list