[Omake] Re: Implicit rules for files in subdirectories

Jason Hickey jyh at cs.caltech.edu
Wed Jun 7 21:40:10 PDT 2006


Benjamin Pierce wrote:
> tmpname(x) =
>   return (tmp/$(basename $(rootname $(x))).tex)
> 
> foreach (x, $(SOURCEFILES))
>   $(tmpname $(x)): $(x) tmp
>     $(SRC2TEX) $< > $@
> 
> Is this optimal?

Yes!  If you want to do this in lots of directories, you can define a 
function.

    # Use $(dir ...) to get a proper name for the directory
    TMP = $(dir tmp)

    buildsrc(srcfiles) =
       foreach(x, $(srcfiles))
          $(TMP)/$(basename $(rootname $x)).tex: $x $(TMP)
             $(SRC2TEX) $< > $@

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