s4:torture: Adapt KDC canon test to Heimdal upstream changes
[samba.git] / third_party / heimdal / lib / hcrypto / libtommath / gen.pl
1 #!/usr/bin/perl -w
2 #
3 # Generates a "single file" you can use to quickly
4 # add the whole source without any makefile troubles
5 #
6 use strict;
7 use warnings;
8
9 open(my $out, '>', 'mpi.c') or die "Couldn't open mpi.c for writing: $!";
10 foreach my $filename (glob 'bn*.c') {
11    open(my $src, '<', $filename) or die "Couldn't open $filename for reading: $!";
12    print {$out} "/* Start: $filename */\n";
13    print {$out} $_ while <$src>;
14    print {$out} "\n/* End: $filename */\n\n";
15    close $src or die "Error closing $filename after reading: $!";
16 }
17 print {$out} "\n/* EOF */\n";
18 close $out or die "Error closing mpi.c after writing: $!";
19
20 system('perl -pli -e "s/\s*$//" mpi.c');