$#ARGV == 0 || die "Usage: perl tarcat.pl Borland-Makefile\n";
&print_makefile($ARGV[0]);
sub print_makefile {
	local(*F);
	open(F,$_[0]) || die "Cannot open '$_[0]'\n";
	while (<F>) {
		if (/^!\s*include\s+\"(.+)\"/) {
			die "Makefile '$1' is included recursively.\n"
				if (grep(/^$1$/,@mfstack));
			push(@mfstack,$1);
			&print_makefile($1);
			pop(@mfstack);
		}
		else {
			s/^(.*[^\s])\\$/\1 \\/;
			print;
		}
	}
	close(F);
}
