Skip to content

Commit

Permalink
ta: allow parallel build (make -jN)
Browse files Browse the repository at this point in the history
Replace the foreach loop in the ta target with dependencies on multiple
targets (one for each TA). As a result, "make -j$(nproc) ta" will now
build TAs in parallel rather than doing one after another. The O=
parameter is removed because we should not override what the caller may
give.

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
  • Loading branch information
jforissier committed Apr 22, 2024
1 parent f639f19 commit ea9f273
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ta/Makefile.gmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,19 @@ all: ta

.PHONY: ta
ta:
$(q)$(foreach dir,$(TA_DIRS), $(MAKE) -C $(dir) O=$(out-dir)/ta/$(dir) &&) true

define add-ta-target
.PHONY: ta-$(1)
ta-$(1):
$(MAKE) -C $(1) O=$(out-dir)/ta/$(1)

ta: ta-$(1)

endef

$(eval $(foreach dir,$(TA_DIRS),$(call add-ta-target,$(dir))))

ta-os_test: ta-os_test_lib ta-os_test_lib_dl

# remove build directories including ta/<ta-name>/ directories.
# Note: $(out-dir) may be a relative path.
Expand Down

0 comments on commit ea9f273

Please sign in to comment.