нужно добавить для target включения из c-файлов

This commit is contained in:
Kolan Sh 2011-07-07 16:26:23 +04:00
parent 2570ee5a58
commit 46a4309afd
1 changed files with 13 additions and 13 deletions

View File

@ -30,7 +30,7 @@ while true ; do
esac esac
done done
# --- Environment --- # ======= Environment =======
sed "s~REP_CC~$REP_CC~ ; s~REP_CXX~$REP_CXX~ ; \ sed "s~REP_CC~$REP_CC~ ; s~REP_CXX~$REP_CXX~ ; \
s~REP_LIBRARIES~$REP_LIBRARIES~ ; s~REP_TARGET~$REP_TARGET~" $ENV_FILE > Makefile s~REP_LIBRARIES~$REP_LIBRARIES~ ; s~REP_TARGET~$REP_TARGET~" $ENV_FILE > Makefile
@ -57,38 +57,38 @@ echo >> Makefile
echo >> Makefile echo >> Makefile
# --- Build --- # ======= Build =======
cat $BUILD_FILE >> Makefile cat $BUILD_FILE >> Makefile
echo >> Makefile echo >> Makefile
# --- Rules --- # ======= Rules =======
cat $RULES_FILE >> Makefile cat $RULES_FILE >> Makefile
REP_INCLUDE=`echo $REP_INCLUDE | sed "s~-I~~g ; s~\\$(HOME)~${HOME}~"` 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 target_dep_lst=`grep ^\#include\ \" $REP_TARGET.c | sed 's~[^"]*"\([^"]*\)"~\1~' | sort -u`
old_all_dep_lst=$all_dep_lst
for f in $all_dep_lst; do while [[ "$target_dep_lst" != "$old_target_dep_lst" ]]; do
old_target_dep_lst=$target_dep_lst
for f in $target_dep_lst; do
F="" F=""
for d in . $REP_INCLUDE; do for d in . $REP_INCLUDE; do
#echo "$d/$f" # | sed "s~^${HOME}~$\(HOME\)~"
if [ -f "$d/$f" ]; then if [ -f "$d/$f" ]; then
F="$d/$f" F="$d/$f"
break break
fi fi
done done
if [ "$F" == "" ]; then if [ "$F" == "" ]; then
echo "file \"$f\" not found" echo "#include \"$f\" - file not found"
exit -1 exit -1
fi fi
#echo "F=$F" target_dep_lst="$target_dep_lst "`grep ^\#include\ \" $F | sed 's~[^"]*"\([^"]*\)"~\1~'`
all_dep_lst="$all_dep_lst "`grep ^\#include\ \" $F | sed 's~[^"]*"\([^"]*\)"~\1~'` target_dep_lst=`echo $target_dep_lst | sed 's~ ~\n~g' | sort -u`
all_dep_lst=`echo $all_dep_lst | sed 's~ ~\n~g' | sort -u`
done done
done done
echo "all_dep_lst=$all_dep_lst" echo "target_dep_lst=$target_dep_lst"