[Omake] Re: non-recursing targets

Aleksey Nogin anogin at hrl.com
Thu Oct 25 11:58:32 PDT 2007


On 25.10.2007 11:48, Sam Steingold wrote:

> Jason Hickey wrote:
>> A .PHONY target is inherited (recursing) only if it is declared before
>> the .SUBDIRS.  If you declare it after the .SUBDIRS, then it is not
>> inherited.  Here is an example OMakefile where each directory has a
>> target "install-local" that is non-recursing, and there is a recursing
>> target "install".  (This example uses a .SUBDIRS body, but you can use
>> separate OMakefiles if you like).
> 
>>     # This target is recursing
>>     .PHONY: install
> 
>>     .SUBDIRS: a b
>>         .PHONY: install-local
> 
> the manual (8.8) says that when .SUBDIRS has a body, the files
> a/OMakefile and b/OMakefile are ignored.
> 
> when I added the above to the top-level OMakefile, subdirectories ceased
> to be compilable.

Sam,

What Jason meant is that in his example he used .SUBDIRS with a body
just to make it concise. You can use a .SUBDIRS without a body and put
Jason's code into the OMakefile files in the subdirectories.

Alternatively, you can keep Jason's format of a .SUBDIRS with a body and
use an explicit "include OMakefile" inside each .SUBDIRS body (this form
is useful if you include several directories with a single .SUBDIRS -
you use the .SUBDIRS body for the code that's common for each directory
and then put the custom code into an OMakefile).

Aleksey

-- 
Aleksey Nogin, Research Scientist
Advanced Technologies Department, Information & System Sciences Lab
HRL Laboratories, LLC, Malibu, CA


More information about the Omake mailing list