From 2cbfae32827809f966bbd22bd17193bc7c059b69 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Thu, 7 Jul 2011 18:31:32 +0400 Subject: [PATCH] =?UTF-8?q?=D1=82=D1=8F=D0=BA,=20=D0=B7=D0=B0=D1=88=D0=B8?= =?UTF-8?q?=D0=B1=D0=B8=D1=81=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/smake/smake.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/bash/smake/smake.sh b/bash/smake/smake.sh index 1d23b8a..56e9d64 100755 --- a/bash/smake/smake.sh +++ b/bash/smake/smake.sh @@ -12,7 +12,7 @@ BUILD_FILE=$SMAKE_DIR/build.smk RULES_FILE=$SMAKE_DIR/rules.smk # Debug -DEBUG=1 +DEBUG=0 # Parameters processing TEMP=`getopt -o c:x:i:l:t: --long cc:,cxx:,include:,libraries:,target: -- "$@"` @@ -69,7 +69,8 @@ REP_INCLUDE=`echo $REP_INCLUDE | sed "s~-I~~g ; s~\\$(HOME)~${HOME}~"` # --- Target deplist --- -target_dep_lst=`remove_c_or_cpp_comments.sed $REP_TARGET.c | grep -P '^[\t ]*#include[\t ]*"' | sed 's~[^"]*"\([^"]*\)".*~\1~' | sort -u` +target_dep_lst=`remove_c_comments.pl $REP_TARGET.c | grep -P '^[\t ]*#include[\t ]*"' | sed 's~[^"]*"\([^"]*\)".*~\1~' | sort -u` +files_not_found= while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do old_target_dep_lst=$target_dep_lst @@ -86,13 +87,23 @@ while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do fi done if [ "$F" == "" ]; then - echo "#include \"$f\": file $f not found" - exit -1 + files_not_found="$files_not_found\n$f" + continue fi - target_dep_lst="$target_dep_lst "`remove_c_or_cpp_comments.sed $REP_TARGET.c | grep -P '^[\t ]*#include[\t ]*"' | sed 's~[^"]*"\([^"]*\)".*~\1~' | sort -u` +#echo F=$F + target_dep_lst="$target_dep_lst "`remove_c_comments.pl $F | grep -P '^[\t ]*#include[\t ]*"' | sed 's~[^"]*"\([^"]*\)".*~\1~' | sort -u` target_dep_lst=`echo $target_dep_lst | sed 's~ ~\n~g' | sort -u` done +#echo "target_dep_lst=$target_dep_lst" +#echo "---------------" done -echo "target_dep_lst=$target_dep_lst" +if [ $DEBUG == 1 ]; then + echo -e "target_dep_lst:\n`echo $target_dep_lst | sed -e 's~ ~\n~g' | sed 's~\(^..\)~ \1~g'`" +fi + +files_not_found=`echo -e "$files_not_found" | sort -u` +if [ "$files_not_found" != "" ]; then + echo WARNING: Include files not found: $files_not_found +fi