tommath/gen.pl

17 lines
586 B
Perl
Raw Normal View History

2003-05-17 08:33:54 -04:00
#!/usr/bin/perl -w
2003-02-28 11:09:08 -05:00
#
2003-05-17 08:33:54 -04:00
# Generates a "single file" you can use to quickly
# add the whole source without any makefile troubles
2003-02-28 11:09:08 -05:00
#
2003-05-17 08:33:54 -04:00
use strict;
2003-02-28 11:09:08 -05:00
2003-05-17 08:33:54 -04:00
open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!";
2003-05-29 09:35:26 -04:00
foreach my $filename (glob "bn*.c") {
2003-05-17 08:33:54 -04:00
open( SRC, "<$filename" ) or die "Couldn't open $filename for reading: $!";
print OUT "/* Start: $filename */\n";
print OUT while <SRC>;
print OUT "\n/* End: $filename */\n\n";
close SRC or die "Error closing $filename after reading: $!";
2003-02-28 11:09:08 -05:00
}
2003-05-29 09:35:26 -04:00
print OUT "\n/* EOF */\n";
2003-05-17 08:33:54 -04:00
close OUT or die "Error closing mpi.c after writing: $!";