Is it possible to tell make
to only build a target if it's sources md5 checksum has changed (instead of the edit time)?
I'm using make
to compile my .tex
files and I need to prevent it from building everything twice all the time.
I've tried using Scons, but I feel this isn't adaptable to other needs I have.
Could it be changed? No. You can not change md5sum of a file as long as the contents of the files are same. And that is the sole purpose of it.
The contents of a file are processed through a cryptographic algorithm, and a unique numerical value – the hash value - is produced that identifies the contents of the file. If the contents are modified in any way, the value of the hash will also change significantly.
If the checksum matches, the files are identical. If not, there's a problem—perhaps the file is corrupted, or you're just comparing two different files. If you downloaded a copy of the file and its checksum doesn't match what you expect, try downloading the file again.
In checksum spoofing an adversary modifies the message body and then modifies the corresponding checksum so that the recipient's checksum calculation will match the checksum (created by the adversary) in the message.
No, this is not supported by Make — as you've found out, support for this feature is one of the reasons why tools like Scons exist.
I found a manual recipe for GNU make, though. Maybe you can use that as a work around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With