tommath/gen.pl

20 lines
629 B
Perl
Raw Normal View History

2003-05-17 12:33:54 +00:00
#!/usr/bin/perl -w
2003-02-28 16:09:08 +00:00
#
2003-05-17 12:33:54 +00:00
# Generates a "single file" you can use to quickly
# add the whole source without any makefile troubles
2003-02-28 16:09:08 +00:00
#
2003-05-17 12:33:54 +00:00
use strict;
2003-02-28 16:09:08 +00:00
2003-05-17 12:33:54 +00:00
open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!";
2003-05-29 13:35:26 +00:00
foreach my $filename (glob "bn*.c") {
2003-05-17 12:33:54 +00: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 16:09:08 +00:00
}
2003-05-29 13:35:26 +00:00
print OUT "\n/* EOF */\n";
2014-10-14 13:48:23 +02:00
close OUT or die "Error closing mpi.c after writing: $!";
system('perl -pli -e "s/\s*$//" mpi.c');