tomsfastmath/gen.pl

18 lines
589 B
Perl
Raw Normal View History

2004-08-25 04:43:43 +02:00
#!/usr/bin/perl -w
#
# Generates a "single file" you can use to quickly
# add the whole source without any makefile troubles
#
use strict;
open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!";
2004-09-19 03:31:44 +02:00
foreach my $filename (glob "*fp_*.c") {
2004-08-25 04:43:43 +02: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: $!";
}
print OUT "\n/* EOF */\n";
2004-09-19 03:31:44 +02:00
close OUT or die "Error closing mpi.c after writing: $!";