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>
This commit is contained in:
Vic (Chun-Ju) Yang
2013-12-23 11:24:52 +08:00
committed by chrome-internal-fetch
parent 08a030e152
commit 56dd81e39c
2 changed files with 7 additions and 9 deletions

View File

@@ -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)

View File

@@ -6,12 +6,4 @@
#
# Build all EC boards and run unit tests
# Build all boards except host
boards=$(ls -1 board | grep -v host)
for b in $boards; do
echo ======== building $b
make BOARD=$b $*
done
# Run unit tests
make BOARD=host runtests $*
echo "$0 is deprecated. Please run 'make buildall' instead."