[Omake] semantics of +=

Jason Hickey jyh at cs.caltech.edu
Wed Sep 20 14:43:39 PDT 2006


David Kågedal wrote:
> I was confused for a while when my omake started hanging.  The problem
> was that I had something like this in my OMakefile:
> 
>     FILES[] =
>         a
>         b
> 
>     FILES +=
>         lex
>         hex
>         mex
> 
> Try to spot the error!  Actually I thought this was a valid way to add
> to an array, but apparently not.  But how is this syntax interpreted?

That's funny:)

The expressions in an indented variable definition are just like the 
top-level expressions in OMake.  They can be any of the various things, 
like more definitions,

    X =
       Y = a
       value $Y$Y

conditionals

    X =
       if $(equal $(OS), Unix)
          value 1
       else
          value 2

commands

    X =
        echo "X is being defined"
        value 2

or even things like rules

    R =
       x: y
          cat $< > $@

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