Perl script for generating makefiles