From 2202239c13aba0074ecb384d57bdf08607e1ee6f Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 8 Jul 2011 15:25:29 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=D1=8F=D1=82?= =?UTF-8?q?=D1=81=D1=8F=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81=D0=B8=D0=BC=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D0=B8=20=D0=BE=D0=B1=D1=8A=D0=B5=D0=BA=D1=82=D0=BE?= =?UTF-8?q?=D0=B2,=20=D0=BD=D0=BE=20=D0=BD=D1=83=D0=B6=D0=BD=D0=BE=20?= =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D1=82=D1=8C=20=D0=B7=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=8B=20=D1=82=D0=B8=D0=BF=D0=B0=20$(HOME)=20?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=B8=D1=81=D0=BA=20C-=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2,=20=D1=80=D0=B0=D1=81=D0=BF=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B2=D0=BE=20=D0=B2?= =?UTF-8?q?=D0=BD=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash/smake/smake.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/bash/smake/smake.sh b/bash/smake/smake.sh index fa15b7d..6c752c7 100755 --- a/bash/smake/smake.sh +++ b/bash/smake/smake.sh @@ -136,7 +136,51 @@ echo -e '\t$(CC) $(LDFLAGS) -o $@ $(target_objs)' >> Makefile echo >> Makefile # --- Object files deplist --- +for cf in `echo "$target_dep_lst" | grep -P '.c$'`; do + CF="" + for d in . $REP_INCLUDE; do + if [ -f "$d/$cf" ]; then + CF="$d/$cf" + break + fi + done + if [ "$CF" == "" ]; then + files_not_dound="$files_not_found\n$cf" + continue + fi + to=`basename "$cf" | sed 's~.c$~.o~'` + + target_dep_lst="$CF "`remove_c_comments.pl $CF | 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 + for f in $target_dep_lst; do + F="" + for d in . $REP_INCLUDE; do + if [ -f "$d/$f" ]; then + F="$d/$f" + break + fi + done + if [ "$F" == "" ]; then + files_not_found="$files_not_found\n$f" + continue + fi + 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 + done + + echo "$to: " >> Makefile + for td in $target_dep_lst; do + td=`echo "$td" | sed 's~^\./~~ ; s~a~a~'` + echo -e "\t$td \\" >> Makefile + done + echo >> Makefile +done