Skip to content
Permalink
Browse files

build: update build-all script, adding branch support

  • Loading branch information...
RMerl committed Aug 13, 2019
1 parent fdd62e3 commit 9c5b4b08448a08acaf0fd3e668fb96cf9ef8de31
Showing with 23 additions and 60 deletions.
  1. +23 −60 tools/build-all
@@ -23,39 +23,24 @@ RSYNC_TREE=y
# Run make clean before build
#CLEANUP_TREE=y

# Set DEFAULTBUILD to "none", then
# uncomment desired models
#
# You can also set DEFAULTBUILD to one of the BUILDMODELS flags (see below)

DEFAULTBUILD="none"
### Uncomment the models you wish to build.

#BAC56=y

BAC68=y
#BAC87=y
BAC87=y

#BAC3200=y
BAC3200=y

BAC88=y
BAC3100=y
BAC5300=y

BAC86=y

#BAX88=y

### Specify at run time through env vars
#
# a) By group
# Example:
# BUILDMODELS="sdk6|sdk7114" ./build-all
#
# Supported flags: all sdk6 sdk7x sdk7114 hnd mips arm none
#
# b) Or individual models (must disable group build):
#
# BN66=y BUILDMODELS="none" ./build-all
#
BAX88=y


### Paths
# Store built images there
@@ -73,41 +58,12 @@ SRC_LOC=~/amng
### End config



if [ -z "$BUILDMODELS" ]; then
BUILDMODELS=$DEFAULTBUILD
fi

if [[ "$BUILDMODELS" =~ "arm" || "$BUILDMODELS" =~ "all" || "$BUILDMODELS" =~ "sdk6" ]] ; then
BAC56=y
BAC68=y
BAC87=y
fi

if [[ "$BUILDMODELS" =~ "arm" || "$BUILDMODELS" =~ "all" || "$BUILDMODELS" =~ "sdk7x" ]] ; then
BAC3200=y
fi

if [[ "$BUILDMODELS" =~ "arm" || "$BUILDMODELS" =~ "all" || "$BUILDMODELS" =~ "sdk7114" ]] ; then
BAC88=y
BAC3100=y
BAC5300=y
fi

if [[ "$BUILDMODELS" =~ "hnd" || "$BUILDMODELS" =~ "all" ]] ; then
BAC86=y
fi


build_fw()
{
BRANCH=$3
FWMODEL=$2
FWPATH=$1
echo "*** $(date +%R) - Starting building $FWMODEL..."
if [ "$FWMODEL" == "rt-ax88u" ]; then
cd ~/amng.ax88/
git checkout rtax88
fi
cd ~/$FWPATH
make $FWMODEL &> output.txt

@@ -135,11 +91,18 @@ clean_tree()
FWPATH=$1
SDKPATH=$2
FWMODEL=$3
BRANCH=$4
echo "*** $(date +%R) - Cleaning up $FWMODEL..."
if [ "$RSYNC_TREE" == "y" ]; then
echo "*** $(date +%R) - Updating $FWMODEL tree..."
rsync -a --del $SRC_LOC/ ~/$FWPATH
fi
cd ~/$FWPATH

CURRENT=$(git branch | grep \* | cut -d ' ' -f2)
if [ "$CURRENT" != "$BRANCH" ] ; then
git checkout $BRANCH
fi

if [ "$CLEANUP_TREE" == "y" ]; then
cd ~/$FWPATH/$SDKPATH
@@ -163,31 +126,31 @@ cp $SRC_LOC/Changelog*.txt $STAGE_LOC/

echo "--- $(date +%R) - Preparing trees"
if [ "$BAC56" == "y" ]; then
clean_tree amng.ac56 release/src-rt-6.x.4708 rt-ac56u
clean_tree amng.ac56 release/src-rt-6.x.4708 rt-ac56u master
fi
if [ "$BAC68" == "y" ]; then
clean_tree amng.ac68 release/src-rt-6.x.4708 rt-ac68u
clean_tree amng.ac68 release/src-rt-6.x.4708 rt-ac68u mainline
fi
if [ "$BAC87" == "y" ]; then
clean_tree amng.ac87 release/src-rt-6.x.4708 rt-ac87u
clean_tree amng.ac87 release/src-rt-6.x.4708 rt-ac87u mainline
fi
if [ "$BAC3200" == "y" ]; then
clean_tree amng.ac3200 release/src-rt-7.x.main/src rt-ac3200
clean_tree amng.ac3200 release/src-rt-7.x.main/src rt-ac3200 mainline
fi
if [ "$BAC3100" == "y" ]; then
clean_tree amng.ac3100 release/src-rt-7.14.114.x/src rt-ac3100
clean_tree amng.ac3100 release/src-rt-7.14.114.x/src rt-ac3100 mainline
fi
if [ "$BAC88" == "y" ]; then
clean_tree amng.ac88 release/src-rt-7.14.114.x/src rt-ac88u
clean_tree amng.ac88 release/src-rt-7.14.114.x/src rt-ac88u mainline
fi
if [ "$BAC5300" == "y" ]; then
clean_tree amng.ac5300 release/src-rt-7.14.114.x/src rt-ac5300
clean_tree amng.ac5300 release/src-rt-7.14.114.x/src rt-ac5300 mainline
fi
if [ "$BAC86" == "y" ]; then
clean_tree amng.ac86 release/src-rt-5.02hnd rt-ac86u
clean_tree amng.ac86 release/src-rt-5.02hnd rt-ac86u mainline
fi
if [ "$BAX88" == "y" ]; then
clean_tree amng.ax88 release/src-rt-5.02axhnd rt-ax88u
clean_tree amng.ax88 release/src-rt-5.02axhnd rt-ax88u rtax88
fi

echo -e "--- $(date +%R) - All trees ready!\n"

0 comments on commit 9c5b4b0

Please sign in to comment.
You can’t perform that action at this time.