From aeb08ee25a836aaaaf09a796eefcce20604d36df Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 25 Feb 2012 23:23:36 +0400 Subject: [PATCH] Run with saved arguments on SMake run without any args. This commit closes #45 feature request. --- smake.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/smake.sh b/smake.sh index 2505369..38de16e 100755 --- a/smake.sh +++ b/smake.sh @@ -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"