Clean the testsuite properly.
[bigint/bigint.git] / Makefile
index 450681e..3018e98 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -27,18 +27,21 @@ library: $(library-objects)
 # Conservatively assume that all the objects depend on all the headers.
 $(library-objects): $(library-headers)
 
-# TESTSUITE
+# TESTSUITE (NOTE: Currently expects a 32-bit system)
 # Compiling the testsuite.
 testsuite.o: $(library-headers)
 testsuite: testsuite.o $(library-objects)
        g++ $^ -o $@
 # Extract the expected output from the testsuite source.
 testsuite.expected: testsuite.cc
-       sed -nre 's,^.*//([^ ]),\1,p' $< >$@
+       nl -ba -p -s: $< | sed -nre 's,^ +([0-9]+):.*//([^ ]),Line \1: \2,p' >$@
 # Run the testsuite.
 .PHONY: test
 test: testsuite testsuite.expected
        ./run-testsuite
+testsuite-cleanfiles = \
+       testsuite.o testsuite testsuite.expected \
+       testsuite.out testsuite.err
 
 # The rules below build a program that uses the library.  They are preset to
 # build ``sample'' from ``sample.cc''.  You can change the name(s) of the
@@ -59,7 +62,7 @@ $(program) : $(program-objects) $(library-objects)
 
 # Delete all generated files we know about.
 clean :
-       rm -f $(library-objects) $(program-objects) $(program)
+       rm -f $(library-objects) $(testsuite-cleanfiles) $(program-objects) $(program)
 
 # I removed the *.tag dependency tracking system because it had few advantages
 # over manually entering all the dependencies.  If there were a portable,