Skip to content
Snippets Groups Projects
Commit f50bf50d authored by Andy Fleming's avatar Andy Fleming Committed by Wolfgang Denk
Browse files

Improve MAKEALL parallel builds


The patch that added parallel builds broke MAKEALL -l, so this
fixes that. At the same time, it improves the termination so
that it shuts down the build threads if you cancel the build.
Lastly, it removes a bunch of debug code.

Signed-off-by: default avatarAndy Fleming <afleming@freescale.com>
Tested-by: default avatarWolfgang Denk <wd@denx.de>
parent bb1c01ea
No related branches found
No related tags found
No related merge requests found
...@@ -340,12 +340,7 @@ LIST_ARM9="$(boards_by_cpu arm920t) \ ...@@ -340,12 +340,7 @@ LIST_ARM9="$(boards_by_cpu arm920t) \
######################################################################### #########################################################################
## ARM11 Systems ## ARM11 Systems
######################################################################### #########################################################################
LIST_ARM11="$(boards_by_cpu arm1136) \ LIST_ARM11="$(boards_by_cpu arm1136)"
imx31_phycore \
imx31_phycore_eet \
mx31pdk \
smdk6400 \
"
######################################################################### #########################################################################
## ARMV7 Systems ## ARMV7 Systems
...@@ -615,6 +610,11 @@ build_target() { ...@@ -615,6 +610,11 @@ build_target() {
target=$1 target=$1
build_idx=$2 build_idx=$2
if [ "$ONLY_LIST" == 'y' ] ; then
list_target ${target}
return
fi
if [ $BUILD_MANY == 1 ] ; then if [ $BUILD_MANY == 1 ] ; then
output_dir="${OUTPUT_PREFIX}/${target}" output_dir="${OUTPUT_PREFIX}/${target}"
mkdir -p "${output_dir}" mkdir -p "${output_dir}"
...@@ -624,11 +624,6 @@ build_target() { ...@@ -624,11 +624,6 @@ build_target() {
export BUILD_DIR="${output_dir}" export BUILD_DIR="${output_dir}"
if [ "$ONLY_LIST" == 'y' ] ; then
list_target ${target}
return
fi
${MAKE} distclean >/dev/null ${MAKE} distclean >/dev/null
${MAKE} -s ${target}_config ${MAKE} -s ${target}_config
...@@ -666,16 +661,15 @@ build_target() { ...@@ -666,16 +661,15 @@ build_target() {
[ -e "${LOG_DIR}/${target}.ERR" ] && cat "${LOG_DIR}/${target}.ERR" [ -e "${LOG_DIR}/${target}.ERR" ] && cat "${LOG_DIR}/${target}.ERR"
#echo "Writing ${donep}${build_idx}"
touch "${donep}${build_idx}" touch "${donep}${build_idx}"
} }
manage_builds() { manage_builds() {
search_idx=${OLDEST_IDX} search_idx=${OLDEST_IDX}
#echo "Searching ${OLDEST_IDX} to ${TOTAL_CNT}" if [ "$ONLY_LIST" == 'y' ] ; then return ; fi
while true; do while true; do
if [ -e "${donep}${search_idx}" ] ; then if [ -e "${donep}${search_idx}" ] ; then
# echo "Found ${donep}${search_idx}"
: $(( CURRENT_CNT-- )) : $(( CURRENT_CNT-- ))
[ ${OLDEST_IDX} -eq ${search_idx} ] && [ ${OLDEST_IDX} -eq ${search_idx} ] &&
: $(( OLDEST_IDX++ )) : $(( OLDEST_IDX++ ))
...@@ -687,10 +681,8 @@ manage_builds() { ...@@ -687,10 +681,8 @@ manage_builds() {
[ ${OLDEST_IDX} -eq ${search_idx} ] && [ ${OLDEST_IDX} -eq ${search_idx} ] &&
: $(( OLDEST_IDX++ )) : $(( OLDEST_IDX++ ))
fi fi
#echo "Checking search ${search_idx} vs ${TOTAL_CNT}"
: $(( search_idx++ )) : $(( search_idx++ ))
if [ ${search_idx} -gt ${TOTAL_CNT} ] ; then if [ ${search_idx} -gt ${TOTAL_CNT} ] ; then
#echo "Checking current ${CURRENT_CNT} vs ${BUILD_NBUILDS}"
if [ ${CURRENT_CNT} -ge ${BUILD_NBUILDS} ] ; then if [ ${CURRENT_CNT} -ge ${BUILD_NBUILDS} ] ; then
search_idx=${OLDEST_IDX} search_idx=${OLDEST_IDX}
sleep 1 sleep 1
...@@ -739,6 +731,12 @@ build_targets() { ...@@ -739,6 +731,12 @@ build_targets() {
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
kill_children() {
kill -- "-$1"
exit
}
print_stats() { print_stats() {
if [ "$ONLY_LIST" == 'y' ] ; then return ; fi if [ "$ONLY_LIST" == 'y' ] ; then return ; fi
...@@ -759,6 +757,10 @@ print_stats() { ...@@ -759,6 +757,10 @@ print_stats() {
fi fi
echo "----------------------------------------------------------" echo "----------------------------------------------------------"
if [ $BUILD_MANY == 1 ] ; then
kill_children $$ &
fi
exit $RC exit $RC
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment