#!/bin/csh -f
#
# Rewrite all subdir makefiles with new generic body

#set files=(*/Makefile)
set files=([A-Z]*/Makefile)

foreach x ($files)
	echo $x
	rm -f $x'-'
	mv $x $x'-'
	awk '{print}/^# END of custom section/{exit(0)}' $x'-' | \
		cat - Makefile.body > $x
#	chmod 444 $x
end

