Rewrite rakefile to handle extensions.