2026-06-03 5:45 AM
Follow-on from Is it possible in STM32CubeIDE to set a compiler dependency on ALL sources?
Specifically, this post:
I guess you could do some sort of hash of all the source code?
This wouldn't stop the version.c file getting rebuilt every time, but it would let you see whether the rest of the code actually changed or not.
Or you could take it further: save the hash in a file somewhere, and only do the touch when the hash has changed?
Any suggestions on how to do this "hash" as a pre-build step? Is there anything included within the CubeIDE build stuff that would do this?
2026-06-05 8:04 PM - edited 2026-06-06 10:44 AM
For hashing files: the busybox bundled with CubeIDE has md5sum, sha256sum and so on.
The question is, how to get the list of c & h files from the Eclipse project. If the project uses "external builder", Eclipse will create makefiles, where you can find the dependencies. Also, you can add custom make targets to do something. Internal builder doesn't expose makefiles. Custom make targets can be added - but they don't seem to work.
We’re moving the ST Community to a new platform to give you a better and more reliable community experience.