# @(#) depend v1.0 Create a makefile of dependencies # Author: Jeffrey Kegler cpparg= linelen=60 # desired length of dependency line for arg in "$@" case $arg in -[CT] | -[UID]*) cpparg="$cpparg $arg" esac for source in "$@" target=`expr "$source" : '\\(.*\\)\\.c$'` if [ -n "$target" ]; then target=`basename "$target"` /lib/cpp $cpparg "$source" | sed -n -e 's/ 1$//' -e 's/^# 1 "\(.*\)"/\1/p' | awk ' BEGIN { deplist = "'$target.o:'" } NR > 1 { used++; if (length(deplist "\t" $0) >= '$linelen') { print deplist "\\" deplist = "\t" $0 } else deplist = deplist "\t" $0 END { if (used) { if (deplist != "") print deplist print } exit 0