libtommath/gen.pl

21 lines
671 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;
use warnings;
2003-02-28 16:09:08 +00: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 16:09:08 +00:00
}
print {$out} "\n/* EOF */\n";
close $out or die "Error closing mpi.c after writing: $!";
2014-10-14 11:48:23 +00:00
system('perl -pli -e "s/\s*$//" mpi.c');