#!/bin/rc echo ' APE=/sys/src/ape <$APE/config LIB=libXXX.a' if(~ $#* 0) { dirs = `{du -a |grep '\.c$'|awk '{print $2}'|sed -e's%[^/]*$%%' -e 's%^\./(.)%\1%' |sort -u} } if not { dirs = $* } echo '#dirs = ' ' '^$dirs echo 'OFILES=\' for(d in $dirs) { ls $d/*.c | sed -e 's%.*/([^/]*)$%\1%' -e 's/\.c/\.$O\\/' | awk '{print "\t" $1 }' } echo # Make sure we have a new line after last file! cat <<'EOF' HFILES=config.h UPDATE=\ mkfile\ $HFILES\ ${OFILES:%.$O=%.c}\ ${TARG:%=%.c}\ ${LIB}\