Commit 1ece193af25159b65a8f4e53abfe2c7389095a5c

Daniel Mendler 2019-10-27T22:48:53

replace gen.pl by cat, rename mpi.c to mp_all.c

diff --git a/.gitignore b/.gitignore
index f1c0a05..a5a4aba 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,8 +60,8 @@ UpgradeLog*.htm
 perf.data
 perf.data.old
 
-# ignore mpi.c generated by make
-mpi.c
+# ignore mp_all.c generated by make
+mp_all.c
 
 # ignore file generated by make tune
 tuning_list
diff --git a/gen.pl b/gen.pl
deleted file mode 100644
index 4db24b5..0000000
--- a/gen.pl
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/perl -w
-#
-# Generates a "single file" you can use to quickly
-# add the whole source without any makefile troubles
-#
-use strict;
-use warnings;
-
-open(my $out, '>', 'mpi.c') or die "Couldn't open mpi.c for writing: $!";
-foreach my $filename (glob '*mp_*.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: $!";
-}
-print {$out} "\n/* EOF */\n";
-close $out or die "Error closing mpi.c after writing: $!";
-
-system('perl -pli -e "s/\s*$//" mpi.c');
diff --git a/makefile b/makefile
index b14976f..7889c5a 100644
--- a/makefile
+++ b/makefile
@@ -71,13 +71,13 @@ profiled:
 
 #make a single object profiled library
 profiled_single:
-	perl gen.pl
-	$(CC) $(LTM_CFLAGS) -fprofile-arcs -DTESTING -c mpi.c -o mpi.o
-	$(CC) $(LTM_CFLAGS) -DTESTING -DTIMER demo/timing.c mpi.o -lgcov -o timing
+	cat *mp_*.c > mp_all.c
+	$(CC) $(LTM_CFLAGS) -fprofile-arcs -DTESTING -c mp_all.c -o mp_all.o
+	$(CC) $(LTM_CFLAGS) -DTESTING -DTIMER demo/timing.c mp_all.o -lgcov -o timing
 	./timing
 	rm -f *.o timing
-	$(CC) $(LTM_CFLAGS) -fbranch-probabilities -DTESTING -c mpi.c -o mpi.o
-	$(AR) $(ARFLAGS) $(LIBNAME) mpi.o
+	$(CC) $(LTM_CFLAGS) -fbranch-probabilities -DTESTING -c mp_all.c -o mp_all.o
+	$(AR) $(ARFLAGS) $(LIBNAME) mp_all.o
 	ranlib $(LIBNAME)
 
 install: $(LIBNAME)
@@ -121,9 +121,9 @@ docs manual:
 .PHONY: pre_gen
 pre_gen:
 	mkdir -p pre_gen
-	perl gen.pl
-	sed -e 's/[[:blank:]]*$$//' mpi.c > pre_gen/mpi.c
-	rm mpi.c
+	cat *mp_*.c > mp_all.c
+	sed -e 's/[[:blank:]]*$$//' mp_all.c > pre_gen/mp_all.c
+	rm mp_all.c
 
 zipup: clean astyle new_file docs
 	@# Update the index, so diff-index won't fail in case the pdf has been created.
diff --git a/makefile_include.mk b/makefile_include.mk
index 650b3e7..b794690 100644
--- a/makefile_include.mk
+++ b/makefile_include.mk
@@ -164,7 +164,7 @@ cleancov: cleancov-clean clean
 clean:
 	rm -f *.gcda *.gcno *.gcov *.bat *.o *.a *.obj *.lib *.exe *.dll etclib/*.o \
 				demo/*.o test timing mtest_opponent mtest/mtest mtest/mtest.exe tuning_list \
-				*.s mpi.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
+				*.s mp_all.c *.da *.dyn *.dpi tommath.tex `find . -type f | grep [~] | xargs` *.lo *.la
 	rm -rf .libs/ demo/.libs
 	${MAKE} -C etc/ clean MAKE=${MAKE}
 	${MAKE} -C doc/ clean MAKE=${MAKE}