tommath/gen.pl

21 lines
671 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;
use warnings;
2003-02-28 11:09:08 -05:00
open(my $out, '>', 'mpi.c') or die "Couldn't open mpi.c for writing: $!";
foreach my $filename (glob 'bn*.c') {
open(my $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
}
print {$out} "\n/* EOF */\n";
close $out or die "Error closing mpi.c after writing: $!";
2014-10-14 07:48:23 -04:00
system('perl -pli -e "s/\s*$//" mpi.c');