# Take each dependency and add it as a target; see http://mad-scientist.net/make/autodep.html #ADD_DEPEND := sed -e 's/\#.*//' -e 's/^[^:]*:[ ]*//' -e 's/ *\\$$//' -e '/^$$/ d' -e 's/$$/ :/' # add a blank line 1i\ # delete comments s/\#.*// # delete the object file and leading colon s/^[^:]*:[ ]*// # delete trailing continuations (backslashes) s/[ ]*\\$// # remove leading white space s/^[ ][ ]*// # add a colon to all non-blank lines to generate a dummy dependancy /[^ ]/s/$/ :/