]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Simplify Makefiles embedded in autotest.at
authorZack Weinberg <zackw@panix.com>
Mon, 27 Jul 2020 17:27:47 +0000 (13:27 -0400)
committerZack Weinberg <zackw@panix.com>
Mon, 27 Jul 2020 17:27:47 +0000 (13:27 -0400)
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

index d30e3df45c5d7a18427fb7cbad43ebc7d71cc0f3..dbd86460c284b67718648619348273465dd50e26 100644 (file)
@@ -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],