summaryrefslogtreecommitdiff
path: root/Makefile.rules
diff options
context:
space:
mode:
authorVic (Chun-Ju) Yang <victoryang@chromium.org>2013-12-23 11:24:52 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-12-27 07:50:56 +0000
commit56dd81e39c578c15f09be358ab53ecd486d2bf22 (patch)
treefabaacc8e59e1de03189432314f0651360dc6536 /Makefile.rules
parent08a030e15267cabcd098a5a7989ce6b652039020 (diff)
downloadchrome-ec-56dd81e39c578c15f09be358ab53ecd486d2bf22.tar.gz
Merge make_all.sh to Makefile
By merging make_all.sh to Makefile, parallel make can be made faster. Previously, if one does 'util/make_all.sh -j32', most of the time is spent on waiting for linking. Now that we invoke sub-make, linking an executable doesn't block the next board. With '-j32', the new 'make buildall' takes about 7 seconds, while the original 'util/make_all.sh' takes about 27 seconds. BUG=None TEST=make buildall -j32 BRANCH=None Change-Id: I7c2f0d1e928a9b60a8a9070bdcb71b00a3d534cd Signed-off-by: Vic (Chun-Ju) Yang <victoryang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/181091 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'Makefile.rules')
-rw-r--r--Makefile.rules6
1 files changed, 6 insertions, 0 deletions
diff --git a/Makefile.rules b/Makefile.rules
index 7c0af672d0..16af68a096 100644
--- a/Makefile.rules
+++ b/Makefile.rules
@@ -12,6 +12,7 @@ build-utils := $(foreach u,$(build-util-bin),$(out)/util/$(u))
host-utils := $(foreach u,$(host-util-bin),$(out)/util/$(u))
build-srcs := $(foreach u,$(build-util-bin),$(sort $($(u)-objs:%.o=util/%.c) util/$(u).c))
host-srcs := $(foreach u,$(host-util-bin),$(sort $($(u)-objs:%.o=util/%.c) util/$(u).c))
+boards := $(filter-out host,$(subst board/,,$(wildcard board/*)))
# Create output directories if necessary
_dir_create := $(foreach d,$(dirs),$(shell [ -d $(out)/$(d) ] || \
@@ -61,6 +62,11 @@ targ_if_prog = $(if $(shell which $(1) 2>/dev/null),$(2),)
.PHONY: all tests utils hosttests
all: $(out)/$(PROJECT).bin utils
+buildall: $(foreach b, $(boards), proj-$(b)) runtests
+proj-%:
+ @echo "======= building $*"; \
+ $(MAKE) --no-print-directory BOARD=$* V=$(V)
+
dis-y = $(out)/$(PROJECT).RO.dis $(out)/$(PROJECT).RW.dis
dis: $(dis-y)