[Omake] scanning of .mly files

Jason Hickey jyh at cs.caltech.edu
Mon Jun 12 13:27:40 PDT 2006


Jason Hickey wrote:
> To continue the brainstorm:
> 
> # Stage <stagename> can only be built after <stagedeps>
> .STAGE: <stagename>: <stagedeps>

Actually, perhaps there is a very simple mechanism along these lines. 
Here is a mechanism, not a syntax.

When a rule is defined:
    - It becomes a dependency of $(STAGE)
    - It depends on $(STAGEDEPS)

These variables would have the appropriate defaults.

This source

    STAGEDEPS = stage-2
    STAGE = stage-1
    boo.ml: boo.src
       ...

is equivalent to the following in the current language

    boo.ml: boo.src
       ...
    boo.ml: stage-2
    stage-1: boo.ml

The stage hierarchy would be defined using the appropriate .PHONY 
targets.  Assuming the default stage is a phony "default", we would 
insert these two stages before it.

    .PHONY: stage-1 stage-2
    default: stage-1
    stage-1: stage-2

Jason

-- 
Jason Hickey                  http://www.cs.caltech.edu/~jyh
Caltech Computer Science      Tel: 626-395-6568 FAX: 626-792-4257


More information about the Omake mailing list