magiclantern_simplified
magiclantern_simplified copied to clipboard
Audit makefiles for bad >> usage, race condition
In multiple places, we build up a file using >> with shell commands for concatenating output. If the target file is a dependency for a make target, e.g. version.c, which version.o depends on, and you build in parallel, it's possible for version.o to attempt to build with an intermediate version of the file, since it may exist on disk at any stage in the process of concatenating file data.
We should probably concat into a temp file, and move that to the correct name as the final step, so intermediate content cannot be seen.