1#!/usr/bin/perl -w 2# 3# Generates a "single file" you can use to quickly 4# add the whole source without any makefile troubles 5# 6use strict; 7 8open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!"; 9foreach my $filename (glob "bn*.c") { 10 open( SRC, "<$filename" ) or die "Couldn't open $filename for reading: $!"; 11 print OUT "/* Start: $filename */\n"; 12 print OUT while <SRC>; 13 print OUT "\n/* End: $filename */\n\n"; 14 close SRC or die "Error closing $filename after reading: $!"; 15} 16print OUT "\n/* EOF */\n"; 17close OUT or die "Error closing mpi.c after writing: $!";