util/abuild: Have abuild generate the .xcompile if it doesn't exist

Previously if .xcompile was missing, abuild would silently ignore the
error. With https://review.coreboot.org/c/coreboot/+/34241 we now check
the return code so abuild started failing.

We should generate the .xcompile if it doesn't exist. The Makefile will
handle that so we include it as the first Makefile.

We then need to override the default target so we don't use the one from
the Makefile.

BUG=b:112267918
TEST=ran abuild and made sure it generated a .xcompile in the root.

Change-Id: I79ded36d47b0219d0b126adff80a57be1c2bdf07
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35137
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Raul E Rangel 2019-08-28 11:33:27 -06:00 committed by Martin Roth
parent 489a11e865
commit 9ff4029db9
1 changed files with 3 additions and 2 deletions

View File

@ -471,13 +471,14 @@ function build_config
required_arches=$(grep -E "^CONFIG_ARCH_(BOOTBLOCK|R.MSTAGE|VERSTAGE)" "$TARGET/${BUILD_NAME}/config.build" | \
sed "s,^CONFIG_ARCH_[^_]*_\([^=]*\)=.*$,\1," |sort -u |tr 'A-Z\n\r' 'a-z ')
missing_arches="$($MAKE --no-print-directory -f - \
REQUIRED_ARCHES="$required_arches" <<'EOF'
missing_arches="$($MAKE --no-print-directory -f Makefile -f - \
REQUIRED_ARCHES="$required_arches" obj="${build_dir}" <<'EOF'
include .xcompile
.PHONY: missing_arches
missing_arches:
$(if $(XCOMPILE_COMPLETE),,$(error .xcompile is invalid.))
@echo $(foreach arch,$(REQUIRED_ARCHES),$(if $(filter $(arch),$(SUBARCH_SUPPORTED)),,$(arch)))
.DEFAULT_GOAL := missing_arches
EOF
)"
# shellcheck disable=SC2181