diff --git a/bash/smake/smake.sh b/bash/smake/smake.sh index 0b530d2..8c6ce9c 100755 --- a/bash/smake/smake.sh +++ b/bash/smake/smake.sh @@ -69,7 +69,7 @@ REP_INCLUDE=`echo $REP_INCLUDE | sed "s~-I~~g ; s~\\$(HOME)~${HOME}~"` # --- Target deplist --- -target_dep_lst=`grep ^\#include\ \" $REP_TARGET.c | sed 's~[^"]*"\([^"]*\)"~\1~' | sort -u` +target_dep_lst=`remove_c_or_cpp_comments.sed $REP_TARGET.c | grep -P '^[\t ]*#include[\t ]*"' | sed 's~[^"]*"\([^"]*\)".*~\1~' | sort -u` while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do old_target_dep_lst=$target_dep_lst @@ -85,7 +85,7 @@ while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do echo "#include \"$f\" - file not found" exit -1 fi - target_dep_lst="$target_dep_lst "`grep ^\#include\ \" $F | sed 's~[^"]*"\([^"]*\)"~\1~'` + 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` target_dep_lst=`echo $target_dep_lst | sed 's~ ~\n~g' | sort -u` done done