[Omake] Using Target outside of a rule body?

Mike Furr furr at cs.umd.edu
Thu Apr 20 11:28:41 PDT 2006


Mike Furr wrote:
> I have an OCaml project which spans several directories.  To build the
> final executable, I would like to just pass the "main" file and have
> OMake figure out all of the object files that need to be linked in.
> Something like:
> 
> foo: $(filter %.cmx, $(target main.cmx).build-deps)
>    $(OCAMLOPTLINK) -o $@ $(file-sort .BUILDORDER, $+)
> 
> However, attempts to use the Target object in the rule declaration gives
> the error "this function can be called only in rule bodies".
Of course, as soon as I posted this, I realized there is no need to
actually have the target list in the declaration.  a dependence on
main.cmx will pull in everything else transitively!  Grabbing the
build-deps in the body works just fine.

Sorry for the noise,
-mike


More information about the OMake-Devel mailing list