#!/bin/sh

ed Makefile << *EOF* > /dev/null
/^# DO NOT DELETE THIS LINE$/
.+1,\$d
w
*EOF*

for src in $*
do
    obj=`basename $src .c`.o
    sed -n "s/^#include \"\([^\"]*\)\"/$obj: \1/p" $src >> Makefile
done

exit 0
