summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2016-05-17 09:55:06 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2016-05-17 09:55:31 +0200
commitc5bc6b39977246f0e52101edd04f451aba9ac364 (patch)
treedc311f933f9d608320f388ee57ace23c67cee18b
parent03e7a91710e5c81dce70c4b26e14b8b3c347776d (diff)
downloadptxdist-c5bc6b39977246f0e52101edd04f451aba9ac364.tar.gz
ptxdist-c5bc6b39977246f0e52101edd04f451aba9ac364.tar.xz
ptxdist: improve output ordering for parallel building
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rwxr-xr-xbin/ptxdist4
-rw-r--r--scripts/lib/ptxd_make_serialize.sh12
2 files changed, 15 insertions, 1 deletions
diff --git a/bin/ptxdist b/bin/ptxdist
index ea16e064a..f9e7d845d 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -2348,6 +2348,10 @@ setup_parallel() {
if [ -z "${PTXDIST_PARALLELMFLAGS}" ]; then
pmf_intern="${pmf_cpus}"
pmf_extern="-j1"
+ elif [ "${PTXDIST_PARALLELMFLAGS}" == "-j1" ]; then
+ unset PTXDIST_PARALLELMFLAGS
+ pmf_intern="-j1"
+ pmf_extern="-j1"
elif [ "${PTXDIST_PARALLELMFLAGS}" == "auto" ]; then
PTXDIST_PARALLELMFLAGS="${pmf_cpus}"
fi
diff --git a/scripts/lib/ptxd_make_serialize.sh b/scripts/lib/ptxd_make_serialize.sh
index ba8fb8bea..a9586df48 100644
--- a/scripts/lib/ptxd_make_serialize.sh
+++ b/scripts/lib/ptxd_make_serialize.sh
@@ -47,12 +47,22 @@ export -f ptxd_make_serialize_setup
ptxd_make_serialize_init() {
local num="${PTXDIST_PARALLELMFLAGS#-j}"
+ local sync
+
+ if make -h | grep -q -- --output-sync; then
+ sync="--output-sync="
+ fi
if [ -n "${num}" ]; then
ptxd_make_serialize_setup global "${num}" || return
- local mflags="-j --jobserver-fds=${ptxd_make_serialize_global_readfd},${ptxd_make_serialize_global_writefd}"
+ local mflags="${sync:+${sync}recurse} -j --jobserver-fds=${ptxd_make_serialize_global_readfd},${ptxd_make_serialize_global_writefd}"
PTXDIST_PARALLELMFLAGS_INTERN="${mflags}"
PTXDIST_PARALLELMFLAGS_EXTERN="${mflags}"
+ else
+ case "${PTXDIST_PARALLELMFLAGS_INTERN}" in
+ -j1) ;;
+ *) PTXDIST_PARALLELMFLAGS_INTERN="${PTXDIST_PARALLELMFLAGS_INTERN} ${sync:+${sync}target --no-print-directory}" ;;
+ esac
fi
ptxd_make_serialize_setup get 4 &&