diff --git a/bash/smake/smake.sh b/bash/smake/smake.sh index 6243071..9613b11 100755 --- a/bash/smake/smake.sh +++ b/bash/smake/smake.sh @@ -135,10 +135,6 @@ while [ $nfiles != $nparsed ]; do let nparsed++ done -for i in `seq 0 $((nfiles-1))`; do - echo ${flist[$i]}:${fdeplist[$i]} -done - # ======= Target rules ======= echo 'target_objs = \' >> Makefile @@ -167,7 +163,6 @@ for i in `seq 0 $((nfiles-1))`; do [[ "$extension" != c && "$extension" != cpp && "$extension" != cxx && "$extension" != cc ]] && continue echo -n `basename $f.o:` >> Makefile - #echo -ne "\t${fpath[$i]}" >> Makefile dep_lst=${fdeplist[$i]} _dep_lst= @@ -193,24 +188,14 @@ for i in `seq 0 $((nfiles-1))`; do echo ' \' >> Makefile echo -ne "\t" >> Makefile fname=${fpath[$j]} - k=`echo $REP_INCLUDE | sed 's~ ~\n~g' | wc -l` - REVERT_REP_INCLUDE=`echo "$REP_INCLUDE" | sed "s~ ~\n~g" | sort -ur` - echo "===================" - echo k=$k - echo "REVERT_REP_INCLUDE=$REVERT_REP_INCLUDE" - echo "===================" - for d in $REVERT_REP_INCLUDE ; do - echo "===================" - echo "fname=$_fname ; d=$d ; INCLUDE$k" + k=1 + for d in $REP_INCLUDE ; do _fname=`echo ${fpath[$j]} | sed "s~^$d~\$\(INCLUDE$k\)~" ` [ "$_fname" != "${fpath[$j]}" ] && fname=$_fname - echo "fname=$_fname ; d=$d ; INCLUDE$k" - echo "===================" - let k-- + let k++ done echo -n "$fname" >> Makefile - #echo -ne "\t${fpath[$j]}" >> Makefile break fi done