ROOT_DIR=${SCRIPT_DIR}/..
DEVICE_TEMP=${SCRIPT_DIR}/.device
+if [ ! -e "$DEVICE_TEMP" ] ; then
+ DEVICE_PREV=1
+else
+ DEVICE_PREV=`cat $DEVICE_TEMP`
+fi
+
if [ -z "$1" ]; then
- if [ ! -e "$DEVICE_TEMP" ] ; then
- DEVICE=1
- else
- DEVICE=`cat $DEVICE_TEMP`
- fi
+ DEVICE=$DEVICE_PREV
else
+ # Clean incremental build after changing $DEVICE
+ if [ $1 -ne $DEVICE_PREV ]; then
+ rm -r ${SCRIPT_DIR}/../build-gbs
+ fi
DEVICE=$1
fi
+echo "$DEVICE" > $DEVICE_TEMP
+
GREEN='\033[0;32m'
NC='\033[0m'
for ARG in $*
do
- echo $ARG
if [ "DEBUG" = $ARG ];then
DEBUG_ON=1
echo 'DEBUG ON'