[Omake] Recursive invocation of omake
Aleksey Nogin
nogin at cs.caltech.edu
Wed Jun 7 11:06:11 PDT 2006
On 07.06.2006 07:12, Benjamin Pierce wrote:
> One specific question that I'm wondering about is when it is good to
> invoke omake recursively.
Not only it's considered bad, but normally it's impossible. OMake will
normally lock the project when it's running and will not allow other
instances of OMake to interfere with the project. In general, many parts
of OMake are optimized towards the notion that a single OMake process
has a complete view of the whole project and the whole-project
compilation (while still being able to pick and build a specific target
from the big project) is one of the basic design goals of OMake.
> In my current tangle of (gnu) makefiles, when I do 'make X' in the
> top-level directory (where X is 'all', 'clean', etc.), it does a little
> bit of work there and then does '$(MAKE) -C DIR X' for every
> sub-directory DIR; the same process then repeats for sub-sub-
> directories, and so on.
>
> Is this a good way to set things up with omake too? Or is there
> another way that uses just a single omake process?
In OMake, there is a ".SUBDIRS: foo bar ..." syntax (in a for of a
pseudo-rule without a body) that tells OMake to incorporate the
subprojects from subdirectories foo and bar. Namely, it tells OMake to
read the foo/OMakefile and interpret everything it finds there relative
to directory foo, then read in bar/OMakefile and interpret it relative
to bar.
BTW, note that normally OMake will attempt to read all the project's
OMakefiles before executing anything.
P.S. ".SUBDIRS" also has a form with a body, but this more complicated
form is only needed if you want to process a number of subdirectories in
a similar manner and avoid having a separate OMakefile in each of them.
--
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