[Omake] depending on the contents of a directory

Aleksey Nogin nogin at metaprl.org
Fri Aug 24 17:07:16 PDT 2007


On 24.08.2007 08:18, Mike Furr wrote:

> I've started adding some system tests to one of my projects and I would 
> like to get OMake to rerun the test suite whenever the input files 
> change (including adding new ones).  Is this possible?
> A first attempt was:
> 
> test_suite.results: $(TEST_PROGRAM) :value: $(stat $(dir [...])).mtime
>     ./$(TEST_PROGRAM) |& tee $@

Mike, note that the syntax is not doing what you want here - you are 
simply appending the ".mtime" string to the stat object... 
Unfortunately, even in 0.9.8.5 there is still no syntax to access a 
field of an anonymous object.

You need to do something like

TEST_DIR = $(dir [...])
mtime(d) =
    s = $(stat $d)
    return $(s.mtime)

... :value: $(mtime $(TEST_DIR))

Alternatively, you can add a regular dependency on $(glob 
$(TEST_DIR)/*), which would be more precise, but less efficient.

Aleksey


More information about the Omake mailing list