1
0
mirror of http://galexander.org/git/simplesshd.git synced 2024-11-30 19:28:10 +00:00
simplesshd/dropbear/libtommath/gen.pl

21 lines
671 B
Perl
Raw Normal View History

2014-12-10 21:56:49 +00:00
#!/usr/bin/perl -w
#
# Generates a "single file" you can use to quickly
# add the whole source without any makefile troubles
#
use strict;
2019-06-09 20:44:26 +00:00
use warnings;
2014-12-10 21:56:49 +00:00
2019-06-09 20:44:26 +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: $!";
2014-12-10 21:56:49 +00:00
}
2019-06-09 20:44:26 +00:00
print {$out} "\n/* EOF */\n";
close $out or die "Error closing mpi.c after writing: $!";
system('perl -pli -e "s/\s*$//" mpi.c');