Here is an example of the problem that I encountered when I started using parallel assemblies. I have a goal called "fresh" that I use to restore the target from scratch (a "new" build). I used to encode a โfreshโ target by simply specifying โcleanโ and then โbuildโ as dependencies.
build:
This worked fine until I started using parallel assemblies, but with parallel assemblies, it tries to do a clean and an assembly at the same time. Therefore, I changed the definition of "fresh" as follows to guarantee the correct order of operations.
fresh: $(MAKE) clean $(MAKE) build
This is basically just a matter of defining dependencies correctly. The trick is that parallel assemblies are more stringent than single-threaded assemblies. My example shows that the list of dependencies for a given target does not necessarily indicate the order of execution.
nobar Apr 10 '10 at 17:42
source share