Let's say I have a build process where one of the steps is applying a transformation to a bunch of files, such that one source file equals one target file. This could be something like compression, encryption, image scaling, etc.
Because doing it every time for all source files takes a long time, I'd like to do it incrementally, so a file is only processed if it's newer than the corresponding target file.
It seems to me that this is a very generic process and condition, so I'm wondering, is there an existing tool that can take care of this part of the process? So that all I need to implement myself is a command that takes an input and output file as parameters (or uses stdin/out) - if it doesn't exist yet.
Linux and/or Windows solutions welcome. Optional bonus features:
- A single source file results in multiple target files (e.g. scaling an image to multiple sizes)
- Multiple source files result in less target files (e.g. archiving bunches of files together)
- Basing the "convert or not"-decision on a hash instead of modification date (more reliable). This would require the transformer to support storing the source hash in the target file, and reading it.
Is this perhaps something that
make can do?