Preventing parallel builds of targets

Follow the process mentioned in this content to prevent parallel builds of targets.

When clearmake builds a makefile target, there might be side effects that you cannot address in a makefile. For example, one of your build tools might create temporary files that are not guaranteed to have unique names and then delete them at the end of its processing. When you use this tool serially, there are no problems. However, if you invoke it in multiple parallel builds in clearmake, the tool might create identical files and cause the builds to interfere with each other.

You can solve this problem by using the .NOTPARALLEL special makefile target. To disable parallel building for a makefile, use this target without any arguments. For example:

.NOTPARALLEL:

To prevent specific targets from being built in parallel with each other, specify them as a set of arguments. Note that parallel builds are prevented only within the set of targets. For example:

.NOTPARALLEL: %.a 
.NOTPARALLEL: x.c y.c

In this example, clearmake does not build any .a file in parallel with any other .a file, and x is not built in parallel with y. However, clearmake can build .a files in parallel with x, y, or any other file.