[Omake] Files in subdirs

Aleksey Nogin nogin at cs.caltech.edu
Fri Jun 23 12:13:30 PDT 2006


On 23.06.2006 04:51, Chris Campbell wrote:

> OCAMLINCLUDES += .. # for OUExt.ml
> 
> .SUBDIRS: maths
>     *.ml, *.mli : $(EMPTY)

Quick note - as you've noticed here, the interaction between relative 
directories in OCAMLINCLUDES and .SUBDIRS is inconvenient. To avoid 
this, you  should use the "dir" function that would turn the string into 
a "node" value. Node values will get expanded to appropriate relative 
filenames - relative the whatever directory you happen to be in.

So, a better way to do the above would be to use

OCAMLINCLUDES += $(dir .)

Also, you can omit the $(EMPTY) above - rules can have empty dependences.

Finally, while it does not matte here (the rule is essentially a no-op), 
what you've defined above is a rule with two targets - one "*ml," (with 
  coma) and another - "*.mli". In "implicit" ("wildcard") rules, the "%" 
symbol acts as a wildcard and in any kind of rules, space acts as a 
separator (and the coma only has special meaning in function arguments):

OCAMLINCLUDES += $(dir .)

.SUBDIRS: maths
    %.ml %.mli:


-- 
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin at cs.caltech.edu (office), aleksey at nogin.org (personal)
Office: Moore 04, tel: (626) 395-2200


More information about the Omake mailing list