Skip to content
Snippets Groups Projects
Commit ae45fbf9 authored by Jerome Forissier's avatar Jerome Forissier Committed by Pascal Brand
Browse files

Rework common.mk


The code added by commits d6536da6 ("Commonlize xtest compilation
among all platforms") and 070d9559 ("common build: optee
components") introduces race conditions that break parallel build (make
-jX). This is due to manually launching a make sub-process to run the
-common targets, and can be fixed by just declaring a dependency
instead. Specific flags are appended to common flags, rather than
passed as arguments to a new "make" sub-process.

So, basically:

 foo-common:
 	$(MAKE) -C foo_dir [A=a B=B]

 foo:
 	$(MAKE) foo-common [C=c]

is turned into:

 FOO_COMMON_FLAGS ?= A=a B=b
 foo-common:
 	$(MAKE) -C foo_dir $(FOO_COMMON_FLAGS)

 FOO_COMMON_FLAGS += C=c
 foo: foo-common

At the same time this allows foo: to override flags, for instance
set A=aa in the above example (prior to this, A=a would have had a
higher priority).

Signed-off-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
Signed-off-by: default avatarPascal Brand <pascal.brand@st.com>
Reviewed-by: default avatarJerome Forissier <jerome.forissier@linaro.org>
parent 070d9559
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment