From df7e1cdbdf012fb2c767836e16639850e7b23818 Mon Sep 17 00:00:00 2001 From: Zack Weinberg Date: Mon, 27 Jul 2020 13:27:47 -0400 Subject: Simplify Makefiles embedded in autotest.at MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a follow-up for the various patches to address problems with tests 221 and 222 with various non-GNU make implementations. We’re not trying to exercise Make at all in these tests; it’s just a convenient way to invoke the compiler found by AC_PROG_CC on a test program. The tests will be more reliable if we minimize the number of Make features we are using. So: no implicit rules at all, and no intermediates. Generate ‘testprog’ directly from ‘testprog.c’. Also copy from fortran.at a more thorough set of substitution variables for the compilation command, mainly for consistency, and don’t use Makefile variables, again for consistency with fortran.at. (This is also, theoretically, faster since we’re only invoking the compiler driver once, but it’s probably not enough of a difference to measure.) --- tests/autotest.at | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/tests/autotest.at b/tests/autotest.at index d30e3df4..dbd86460 100644 --- a/tests/autotest.at +++ b/tests/autotest.at @@ -1909,17 +1909,8 @@ AT_DATA([testprog.c], # Testsuite AT_DATA([Makefile.in], -[[CC=@CC@ -CFLAGS=@CFLAGS@ - -testprog@EXEEXT@: testprog.o - $(CC) -o testprog@EXEEXT@ testprog.o - -testprog.o: testprog.c -.SUFFIXES: .c .o - -.c.o: - $(CC) -c $< +[[testprog@EXEEXT@: testprog.c + @CC@ @CPPFLAGS@ @CFLAGS@ @LDFLAGS@ -o testprog@EXEEXT@ testprog.c ]]) AT_CHECK_AT_PREP([suite], @@ -1970,17 +1961,8 @@ AT_DATA([testprog.c], # Testsuite AT_DATA([Makefile.in], -[[CC=@CC@ -CFLAGS=@CFLAGS@ - -testprog@EXEEXT@: testprog.o - $(CC) -o testprog@EXEEXT@ testprog.o - -testprog.o: testprog.c -.SUFFIXES: .c .o - -.c.o: - $(CC) -c $< +[[testprog@EXEEXT@: testprog.c + @CC@ @CPPFLAGS@ @CFLAGS@ @LDFLAGS@ -o testprog@EXEEXT@ testprog.c ]]) AT_CHECK_AT_PREP([suite], -- cgit v1.2.1