#!/bin/sh
( sed -n '1,/^# DEPEND/p' Makefile ; \
  echo manual.dvi: *.tex ; \
  echo Makefile: *.tex ; \
  perl -n -e '/figurehere{([^}]*)}/ && print "manual.dvi: $1.eps\n";' *.tex ; \
) > makefile2
mv makefile2 Makefile

