Run with saved arguments on SMake run without any args. This commit closes #45 feature request.

This commit is contained in:
Kolan Sh 2012-02-25 23:23:36 +04:00
parent 73197d7be8
commit aeb08ee25a
1 changed files with 10 additions and 0 deletions

View File

@ -22,6 +22,16 @@ RULES_FILE=$SMAKE_DIR/rules.smk
DEBUG=1
SMAKE_PARAMS=$@
# If no options set then execute smake.sh with options saved in Makefile on last smake.sh run
if [ "" == "$*" ]; then
run_cmd=`head -n1 Makefile 2>/dev/null | sed 's~.*: \(smake.sh\)~\1~' | sed "s~^smake.sh~$0~"`
if [ "" != "$run_cmd" ]; then
echo $run_cmd
$run_cmd
exit $?
fi
fi
# Parameters processing
TEMP=`getopt -o hS:P:I:l:c:x:t: --long help,sources:,package:,include:,libs:,cc:,cxx:,target: -- "$@"`
eval set -- "$TEMP"