From 46a4309afd5491049091b83d407624fd6b57b5e7 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Thu, 7 Jul 2011 16:26:23 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=20=D0=B4=D0=BE?= =?UTF-8?q?=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=B4=D0=BB=D1=8F=20tar?= =?UTF-8?q?get=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B8=D0=B7=20c-=D1=84=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/smake/smake.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/bash/smake/smake.sh b/bash/smake/smake.sh index 52fa1d1..0b530d2 100755 --- a/bash/smake/smake.sh +++ b/bash/smake/smake.sh @@ -30,7 +30,7 @@ while true ; do esac done -# --- Environment --- +# ======= Environment ======= sed "s~REP_CC~$REP_CC~ ; s~REP_CXX~$REP_CXX~ ; \ s~REP_LIBRARIES~$REP_LIBRARIES~ ; s~REP_TARGET~$REP_TARGET~" $ENV_FILE > Makefile @@ -57,38 +57,38 @@ echo >> Makefile echo >> Makefile -# --- Build --- +# ======= Build ======= cat $BUILD_FILE >> Makefile echo >> Makefile -# --- Rules --- +# ======= Rules ======= cat $RULES_FILE >> Makefile REP_INCLUDE=`echo $REP_INCLUDE | sed "s~-I~~g ; s~\\$(HOME)~${HOME}~"` -all_dep_lst=`grep ^\#include\ \" $REP_TARGET.c | sed 's~[^"]*"\([^"]*\)"~\1~' | sort -u` +# --- Target deplist --- -while [[ "$all_dep_lst" != "$old_all_dep_lst" ]]; do - old_all_dep_lst=$all_dep_lst - for f in $all_dep_lst; do +target_dep_lst=`grep ^\#include\ \" $REP_TARGET.c | sed 's~[^"]*"\([^"]*\)"~\1~' | sort -u` + +while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do + old_target_dep_lst=$target_dep_lst + for f in $target_dep_lst; do F="" for d in . $REP_INCLUDE; do - #echo "$d/$f" # | sed "s~^${HOME}~$\(HOME\)~" if [ -f "$d/$f" ]; then F="$d/$f" break fi done if [ "$F" == "" ]; then - echo "file \"$f\" not found" + echo "#include \"$f\" - file not found" exit -1 fi - #echo "F=$F" - all_dep_lst="$all_dep_lst "`grep ^\#include\ \" $F | sed 's~[^"]*"\([^"]*\)"~\1~'` - all_dep_lst=`echo $all_dep_lst | sed 's~ ~\n~g' | sort -u` + target_dep_lst="$target_dep_lst "`grep ^\#include\ \" $F | sed 's~[^"]*"\([^"]*\)"~\1~'` + target_dep_lst=`echo $target_dep_lst | sed 's~ ~\n~g' | sort -u` done done -echo "all_dep_lst=$all_dep_lst" +echo "target_dep_lst=$target_dep_lst"