build.sh: fix the ordering of the steps

This commit is contained in:
Daniel Frank 2019-08-16 22:53:20 +02:00
parent 9eadb86c82
commit e763875644
Signed by: tokudan
GPG key ID: 063CCCAD04182D32

View file

@ -78,17 +78,9 @@ export GLUON_RELEASE
export GLUON_BRANCH export GLUON_BRANCH
export GLUON_SITEDIR="${site_path}" export GLUON_SITEDIR="${site_path}"
export GLUON_OUTPUTDIR="${gluon_out}/${GLUON_RELEASE}/${GLUON_BRANCH}" export GLUON_OUTPUTDIR="${gluon_out}/${GLUON_RELEASE}/${GLUON_BRANCH}"
pushd "${gluon_path}"
if [ "$auto_targets" = "1" ]; then
# detect available targets
targets="$(make | awk '$1 == "*" {print $2}' | sort | xargs)"
else
# if a list of build targets has been supplied, only build those
targets="$(echo "${build_targets:-$targets}" | sed -e 's_,_ _g')"
fi
announce "The following targets will be generated: $targets" >&2
popd popd
pushd "${gluon_path}"
announce Starting make update... announce Starting make update...
rm -rf "${GLUON_OUTPUTDIR}" rm -rf "${GLUON_OUTPUTDIR}"
mkdir -p "${GLUON_OUTPUTDIR}" mkdir -p "${GLUON_OUTPUTDIR}"
@ -101,6 +93,16 @@ for p in "${site_path}"/patches/*.patch; do
touch "${gluon_path}/${p##*/}" touch "${gluon_path}/${p##*/}"
fi fi
done done
if [ "$auto_targets" = "1" ]; then
# detect available targets
targets="$(make | awk '$1 == "*" {print $2}' | sort | xargs)"
else
# if a list of build targets has been supplied, only build those
targets="$(echo "${build_targets:-$targets}" | sed -e 's_,_ _g')"
fi
announce "The following targets will be generated: $targets" >&2
for t in $targets; do for t in $targets; do
announce "Starting build for $t..." >&2 announce "Starting build for $t..." >&2
make "-j$(nproc)" "GLUON_TARGET=$t" "$verbose" make "-j$(nproc)" "GLUON_TARGET=$t" "$verbose"