Commit e866eb6
authored
meta/Makefile: use &: for grouped targets (opencomputeproject#2200)
The meta/Makefile contains several rules which are not correct
for parallel make. These rules contain several targets to the
left of the colon, and express the intent that the targets are
built together as a group. Unfortunately, that's not what the
syntax means: Rather:
t1 t2 t3 : prereq
recipe # recipe generates all three!
is essentially a syntactic sugar condensing multiple rules
with the same recipe and prerequisites:
t1 : prereq
recipe # recipe generates all three!
t2 : prereq
recipe
t3 : prereq
recipe
Under parallel make these rules fire in parallel which can
wreak havoc, since they stomp on each other's files.
The issue can be addressed using the grouped targets feature:
t1 t2 t3 &: prereq
recipe # recipe generates all three!
The ampersand-colon separator &: means that there is only one
rule here which Make understands to be updating all three
targets.
This feature has been available since GNU Make 4.2.90.
Ubuntu-latest is on 4.3.
(The grouped targets feature was the subject of a bugfix before
4.4. The bug potentially causes a grouped target not to be
remade if it is deleted. This is minor problem because it's
not expected that someone will be deleting, say, the generated
file saimetadata.c individually rather than doing a "make clean"
which deletes all the generated files.)
Signed-off-by: Kaz Kylheku <[email protected]>1 parent 401bd1f commit e866eb6
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
| 134 | + | |
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
| |||
0 commit comments