tomsfastmath/gen.pl

21 lines
725 B
Perl
Raw Normal View History

2004-08-25 04:43:43 +02:00
#!/usr/bin/perl -w
#
# Generates a "single file" you can use to quickly
# add the whole source without any makefile troubles
#
2019-10-03 16:54:37 +02:00
# SPDX-License-Identifier: Unlicense
2004-08-25 04:43:43 +02:00
use strict;
open( OUT, ">mpi.c" ) or die "Couldn't open mpi.c for writing: $!";
print OUT "#define TFM_PRE_GEN_MPI_C\n";
foreach my $filename (glob "src/*/*fp_*.c") {
2007-03-14 18:58:46 +01:00
next if ($filename eq "fp_sqr_comba_generic.c");
2004-08-25 04:43:43 +02:00
open( 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: $!";
}
print OUT "\n/* EOF */\n";
2004-09-19 03:31:44 +02:00
close OUT or die "Error closing mpi.c after writing: $!";