Skip to content
Snippets Groups Projects
Commit c8612c60 authored by Fred Wright's avatar Fred Wright Committed by Christopher Nielsen
Browse files

Makefile: Fix parallel builds.

Creating directories with "install -d" suffers from a race condition,
because, although it first-order avoids creating directories that
already exist, if multiple instances attempt to create a given
directory at the same time, the error due to a collision is not
correctly handled.  To get around this, we make separate recipes for
directory creation, with dependencies on them in the rules that
populate them.

Unfortunately, this makes the automatic variables useless for some of
the populating commands, since they include the directories.  In such
cases, we need to use explicit variables for the input files.

Maintaining the unused ability to put static and dynamic libraries in
separate directories (while not actually being separate) would have
complicated things, so that capability has been dropped.

This special treatment of directories is not applied to the
installation of headers, since that's a complicated multi-directory
target only used in a single recipe, and hence not vulnerable to
parallelism.

TESTED:
All builds now succeed with parallelism, including those that
previously exhibited a failure.
parent 33e1b3f8
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment