1#!/bin/sh23set -e45trap 'rm -f $tmp' EXIT6trap 'exit $?' HUP INT TERM78tmp=$$.tmp910(cat Makefile11printf "\n#deps\n"12for i in *.c13do14 if test "$i" = '*.c'15 then16 continue17 fi1819 file=`basename $i | sed 's/\.c$/.o/'`20 dir=`dirname $i`2122 sed -n "/^#include / {23 s///24 s@\"\(.*\)\"@$dir/$file: $dir/\1@p25 s@<\(scc/.*\)>@$dir/$file: \$(INCDIR)/bits/\1@p26 }" $i27done |28sed -e 's@^\./@@' -e 's@ \./@ @g' |29LC_ALL=C sort -s) > $tmp3031mv $tmp makefile