Merge pull request #26 from aewag/develop
[tomsfastmath.git] / gen.pl
blob53a75e47b09cdc72e1c560d26189ef424cf4c41b
1 #!/usr/bin/perl -w
3 # Generates a "single file" you can use to quickly
4 # add the whole source without any makefile troubles
6 # SPDX-License-Identifier: Unlicense
7 use strict;
9 open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!";
10 print OUT "#define TFM_PRE_GEN_MPI_C\n";
11 foreach my $filename (glob "src/*/*fp_*.c") {
12 next if ($filename eq "fp_sqr_comba_generic.c");
13 open( SRC, "<$filename" ) or die "Couldn't open $filename for reading: $!";
14 print OUT "/* Start: $filename */\n";
15 print OUT while <SRC>;
16 print OUT "\n/* End: $filename */\n\n";
17 close SRC or die "Error closing $filename after reading: $!";
19 print OUT "\n/* EOF */\n";
20 close OUT or die "Error closing mpi.c after writing: $!";