wmake: Simplified handling of '-j' option to sub-processes

This commit is contained in:
Henry Weller
2016-07-09 14:22:29 +01:00
parent c022898851
commit cdb5d024f0

View File

@ -225,6 +225,8 @@ fi
if [ "$WM_NCOMPPROCS" ] if [ "$WM_NCOMPPROCS" ]
then then
parOpt="-j $WM_NCOMPPROCS"
if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ] if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
then then
lockDir=$HOME/.$WM_PROJECT/.wmake lockDir=$HOME/.$WM_PROJECT/.wmake
@ -236,7 +238,7 @@ then
mkdir -p $lockDir mkdir -p $lockDir
fi fi
make="$make --no-print-directory -j "$WM_NCOMPPROCS make="$make --no-print-directory $parOpt"
fi fi
fi fi
@ -281,21 +283,11 @@ if [ -n "$update" ]
then then
wrmdep -update wrmdep -update
wrmdep -old wrmdep -old
if [ "$all" != "queue" ] wmakeLnIncludeAll -update $parOpt
then
if [ -n "$WM_NCOMPPROCS" ]
then
wmakeLnIncludeAll -j$WM_NCOMPPROCS
else
wmakeLnIncludeAll
fi
fi
wclean empty wclean empty
export WM_UPDATE_DEPENDENCIES=yes export WM_UPDATE_DEPENDENCIES=yes
fi fi
unset update
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Recurse the source tree to compile "all" targets # Recurse the source tree to compile "all" targets
@ -343,24 +335,21 @@ fi
# Recurse the source tree to compile "all" targets using wmakeQueue # Recurse the source tree to compile "all" targets using wmakeQueue
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
scheduler="wmakeCollect"
if [ "$all" = "queue" ] if [ "$all" = "queue" ]
then then
[ -n "$update" ] || wmakeLnIncludeAll $parOpt
( \ ( \
wmakeLnIncludeAll -j$WM_NCOMPPROCS \ WM_COLLECT_DIR=$WM_PROJECT_DIR/platforms/${WM_OPTIONS}/${PWD////_} \
&& WM_COLLECT_DIR=$WM_PROJECT_DIR/platforms/${WM_OPTIONS}/${PWD////_} \ WM_SCHEDULER=wmakeCollect \
WM_SCHEDULER=$scheduler \ trap '$WM_SCHEDULER -kill' TERM INT; \
trap '$scheduler -kill' TERM INT; \ $WM_SCHEDULER -clean \
$scheduler -clean \
&& wmake -all objects \ && wmake -all objects \
&& $scheduler \ && $WM_SCHEDULER \
) && wmake -all ) && wmake -all
exit $? exit $?
fi fi
unset scheduler
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# Search up the directory tree for the Make sub-directory, # Search up the directory tree for the Make sub-directory,