Reputation: 2986
For a small project, I have the following workflow:
./data
and ./images
./data
./images
I have written a makefile, which can run the code, and compile it before, if necessary. But I don't know how to implement the dependencies of steps 3 and 4, and currently make that targets manually.
So, is there a way to check if e.g. the newest file in ./data
is newer than the newest file in ./images
? It's not necessary to do this on a file-by-file basis, and the total number of data / image files is not known.
Upvotes: 1
Views: 79
Reputation: 3520
Typically the date of the directory is the date that the last file was added/modified, so you could use the timestamp on the directory itself for dependencies.
images : data
// generate images
Alternatively, if there is a mapping between the files in the two directories, you could do something like:
images/%.img: data/%.dat
// generate image...
which would prevent reprocessing data that's already been handled.
Upvotes: 1