Rev | Line | |
---|
[1] | 1 | |
---|
| 2 | |
---|
| 3 | function action () |
---|
| 4 | { |
---|
| 5 | file=$1 |
---|
| 6 | |
---|
| 7 | suffix=`echo ${file} | sed -e 's#.*[.]##'` |
---|
| 8 | |
---|
| 9 | eval cpp -M ${incl} ${file} |
---|
| 10 | |
---|
| 11 | eval cpp -M ${incl} ${file} | \ |
---|
| 12 | sed -e 's#[.]o:#_'"${suffix}"'_dependencies = #' | \ |
---|
| 13 | egrep -v '(/usr/include|/usr/lib)' | eval sed ${e} |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | use_includes=`cmt -quiet show macro use_includes | grep use_includes= | sed -e 's#use_includes=.##' -e 's#.$##'` |
---|
| 17 | includes=`cmt -quiet show macro includes | grep includes= | sed -e 's#$[(]use_includes[)]#'"${use_includes}"'#' -e 's#includes=.##' -e 's#.$##' -e 's#$(ppcmd)##g' -e 's#["]##g'` |
---|
| 18 | |
---|
| 19 | tmp1=/tmp/A$$ |
---|
| 20 | tmp2=/tmp/B$$ |
---|
| 21 | tmp3=/tmp/C$$ |
---|
| 22 | |
---|
| 23 | echo ${includes} >|${tmp1} |
---|
| 24 | cmt filter ${tmp1} ${tmp2} |
---|
| 25 | |
---|
| 26 | a=`cat ${tmp1} | sed -e 's#[ ][ ]*# #g' -e 's#^[ ]##'` |
---|
| 27 | b=`cat ${tmp2} | sed -e 's#[ ][ ]*# #g' -e 's#^[ ]##'` |
---|
| 28 | |
---|
| 29 | e=; i=1; for x in `echo ${a}`; do y=`echo $b | cut -d' ' -f${i}`; i=`expr ${i} + 1`; e="${e} -e 's#${y}#${x}#'"; done |
---|
| 30 | |
---|
| 31 | incl=; for f in `echo $includes | sed -e 's#[(]#{#g' -e 's#[)]#}#'`; do incl="${incl} -I${f}"; done |
---|
| 32 | echo e=$e |
---|
| 33 | |
---|
| 34 | files=$* |
---|
| 35 | |
---|
| 36 | for f in `echo ${files}`; do |
---|
| 37 | action ${f} |
---|
| 38 | done |
---|
| 39 | |
---|
| 40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.