3 ## $Id: makedepend 5787 2002-09-29 23:32:52Z rra $
5 ## Generate dependencies for INN makefiles
7 ## This shell script automates the process of updating the dependencies in
8 ## INN's Makefiles. It uses gcc -MM to do this, since only the maintainers
9 ## should normally have to do this and using a compiler to parse include
10 ## directives is more reliable than more ad hoc methods. It takes compiler
11 ## flags as its first argument and then a list of all source files to
14 ## The Makefile is updated in place, and everything after "DO NOT DELETE
15 ## THIS LINE" is removed and replaced by the dependencies.
19 sed '1,/DO NOT DELETE THIS LINE/!d' < Makefile > .makefile.tmp
20 for source in "$@" ; do
23 base=`echo "$source" | sed 's/\..*//'`
24 gcc -MM $flags "$source" | sed "s%^[^.: ][^.: ]*%$base%" \
28 gcc -MM $flags "$source" >> .makefile.tmp
36 mv -f .makefile.tmp Makefile