Source

gen_tcpd / erldep

Full commit
#!/bin/sh
rm -f depend
touch depend
for f in $1/*.erl; do
	beam=`basename $f | sed -e "s/erl$/beam/"`
	line="$beam:"
	deps=false
	for m in `grep "^[ ]*-include(\".*\")" $f | sed -e 's/-include(\"\(.*\)\")\./\1/'`; do
		deps=true
		line="$line $m"
	done
	if `$deps`; then
		echo $line >> depend
	fi
done