makedepend 810 B

1234567891011121314151617181920212223
  1. : 'Without arguments, this program clears the dependencies between'
  2. : '.o files and included files in Makefile.'
  3. : 'With arguments, it replaces the dependencies between the .o files'
  4. : 'resulting from the argument files, and the included files in Makefile.'
  5. : 'Makefile must contain a line with on it the pattern AUTOAUTOAUTO.'
  6. : 'WARNING: a temporary file is created in the current directory.'
  7. : 'It is however rather unlikely that this file already exists'
  8. grep -s AUTOAUTOAUTO Makefile || {
  9. echo "Makefile has wrong format." 1>&2
  10. exit 1
  11. }
  12. for file do
  13. ofile=`echo $file | sed 's/.$/o/'`
  14. grep '^# *include.*"' $file | sed "s/.*\"\(.*\)\".*/$ofile: \1/"
  15. done | sort -u > @@**##$$
  16. echo "Non-empty line." >> Makefile
  17. ed - Makefile <<'!'
  18. /AUTOAUTOAUTO/+,$d
  19. w
  20. q
  21. !
  22. cat @@**##$$ >> Makefile
  23. rm -f @@**##$$