[Omake] Re: Restarting omake

David Kågedal david at virtutech.se
Mon Sep 18 15:35:13 PDT 2006


Aleksey Nogin <nogin at metaprl.org> writes:

> Hi David,
>
> On 18.09.2006 07:17, David Kågedal wrote:
>
>>                 # Check if the module build dir exists
>>                 if $(file-exists ./$m)
>>                     .SUBDIR: $m
>>                     # The $m/OMakefile in the module contains a rule to
>>                     # build $m/module.so
>>                 else
>>                     .PHONY: $m/module.so
>>                     $m/module.so :
>>                         mkdir $m
>>                         RestartOMake()
>> The point is that if the build directory didn't exist, an alternat
>> build rule is used that creates the build directory and restarts
>> omake, so that it can rescan the omakefiles and find the new module.
>
> I am not sure if I fully understand your example, but have you
> considered that:
>
> - You do not have to have an OMakefile in every directory. If you use
> the .SUBDIRS with a body:
>
> .SUBDIRS: foo bar
>    body
>
> than the body will be evaluated (twice in the above example - once for
> each of the subdirectories) in place of the OMakefile. In fact, the
> usual

[...]

> This approach is very useful if you do not want to have a big
> collection of identical (or similar) OMakefiles.

Yes I know that and use it in a number of places.  But in this case
the OMakefiles are all different.

> - The directory only needs to exist when you evaluate the
> .SUBDIRS. The following should work, I believe:
>
> if $(not $(file-exists $m/OMakefile))
>    mkdir $m
>    touch $m/OMakefile
> .SUBDIRS: $m

But the problem is that I don't know which directories to create until
checking the targets given om the command line.  Unless, of course, I
want to create all the directories.  Which was what I was trying to
avoid if possible.

> - When you are running omake with a -p or -P option, it will
> automatically restart if it detects that any of the OMakefiles that it
> have already read have changed.

But can that be forced to happen even when not using -p?

-- 
David Kågedal, Virtutech



More information about the Omake mailing list