* automake.in (handle_tests_dejagnu): New, extracted from...
authorAkim Demaille <akim@epita.fr>
Mon, 29 Jan 2001 12:00:56 +0000 (12:00 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 29 Jan 2001 12:00:56 +0000 (12:00 +0000)
(handle_tests): here.  Use `.PHONY:'.

ChangeLog
automake.in

index 41cf6a7..de4aded 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2001-01-29  Akim Demaille  <akim@epita.fr>
 
+       * automake.in (handle_tests_dejagnu): New, extracted from...
+       (handle_tests): here.  Use `.PHONY:'.
+
+       
+2001-01-29  Akim Demaille  <akim@epita.fr>
+
        * automake.in (handle_phony): Sort.
        (file_contents_with_transform): Catch `.PHONY:'.
        (handle_tests): Instead dumping the hard coded target check-TESTS
index 75b22ac..24fb85f 100755 (executable)
@@ -4061,75 +4061,83 @@ sub handle_phony
     $output_rules .= "\n";
 }
 
-# Handle TESTS variable and other checks.
-sub handle_tests
+
+# handle_tests_dejagnu()
+# ----------------------
+sub handle_tests_dejagnu
 {
-    if (defined $options{'dejagnu'})
+    push (@check_tests, 'check-DEJAGNU');
+
+    local ($xform);
+    if ($cygnus_mode)
+    {
+        $xform = 's/^CYGNUS//;';
+    }
+    else
     {
-       push (@check_tests, 'check-DEJAGNU');
-       push (@phony, 'check-DEJAGNU');
+        $xform = 's/^CYGNUS.*$//;';
+    }
+    $output_rules .= &file_contents_with_transform ($xform, 'dejagnu');
+
+    # In Cygnus mode, these are found in the build tree.
+    # Otherwise they are looked for in $PATH.
+    &define_program_variable ('EXPECT', 'build', 'expect', 'expect');
+    &define_program_variable ('RUNTEST', 'src', 'dejagnu', 'runtest');
+
+    # Only create site.exp rule if user hasn't already written
+    # one.
+    if (! &target_defined ('site.exp'))
+    {
+        # Note that in the rule we don't directly generate
+        # site.exp to avoid the possibility of a corrupted
+        # site.exp if make is interrupted.  Jim Meyering has some
+        # useful text on this topic.
+        $output_rules .= ("site.exp: Makefile\n"
+                          . "\t\@echo 'Making a new site.exp file...'\n"
+                          . "\t\@test ! -f site.bak || rm -f site.bak\n"
+                          . "\t\@echo '## these variables are automatically generated by make ##' > \$\@-t\n"
+                          . "\t\@echo '# Do not edit here.  If you wish to override these values' >> \$\@-t\n"
+                          . "\t\@echo '# edit the last section' >> \$\@-t\n"
+                          . "\t\@echo 'set tool \$(DEJATOOL)' >> \$\@-t\n"
+                          . "\t\@echo 'set srcdir \$(srcdir)' >> \$\@-t\n"
+                          . "\t\@echo 'set objdir' \`pwd\` >> \$\@-t\n");
+
+        # Extra stuff for AC_CANONICAL_*
+        local (@whatlist) = ();
+        if ($seen_canonical)
+        {
+            push (@whatlist, 'host');
+        }
 
-       local ($xform);
-       if ($cygnus_mode)
-       {
-           $xform = 's/^CYGNUS//;';
-       }
-       else
-       {
-           $xform = 's/^CYGNUS.*$//;';
-       }
-       $output_rules .= &file_contents_with_transform ($xform, 'dejagnu');
-
-       # In Cygnus mode, these are found in the build tree.
-       # Otherwise they are looked for in $PATH.
-       &define_program_variable ('EXPECT', 'build', 'expect', 'expect');
-       &define_program_variable ('RUNTEST', 'src', 'dejagnu', 'runtest');
-
-       # Only create site.exp rule if user hasn't already written
-       # one.
-       if (! &target_defined ('site.exp'))
-       {
-           # Note that in the rule we don't directly generate
-           # site.exp to avoid the possibility of a corrupted
-           # site.exp if make is interrupted.  Jim Meyering has some
-           # useful text on this topic.
-           $output_rules .= ("site.exp: Makefile\n"
-                             . "\t\@echo 'Making a new site.exp file...'\n"
-                             . "\t\@test ! -f site.bak || rm -f site.bak\n"
-                             . "\t\@echo '## these variables are automatically generated by make ##' > \$\@-t\n"
-                             . "\t\@echo '# Do not edit here.  If you wish to override these values' >> \$\@-t\n"
-                             . "\t\@echo '# edit the last section' >> \$\@-t\n"
-                             . "\t\@echo 'set tool \$(DEJATOOL)' >> \$\@-t\n"
-                             . "\t\@echo 'set srcdir \$(srcdir)' >> \$\@-t\n"
-                             . "\t\@echo 'set objdir' \`pwd\` >> \$\@-t\n");
-
-           # Extra stuff for AC_CANONICAL_*
-           local (@whatlist) = ();
-           if ($seen_canonical)
-           {
-               push (@whatlist, 'host');
-           }
+        # Extra stuff only for AC_CANONICAL_SYSTEM.
+        if ($seen_canonical == $AC_CANONICAL_SYSTEM)
+        {
+            push (@whatlist, 'target', 'build');
+        }
 
-           # Extra stuff only for AC_CANONICAL_SYSTEM.
-           if ($seen_canonical == $AC_CANONICAL_SYSTEM)
-           {
-               push (@whatlist, 'target', 'build');
-           }
+        local ($c1, $c2);
+        foreach $c1 (@whatlist)
+        {
+            foreach $c2 ('alias', 'triplet')
+            {
+                $output_rules .= "\t\@echo 'set ${c1}_${c2} \$(${c1}_${c2})' >> \$\@-t\n";
+            }
+        }
 
-           local ($c1, $c2);
-           foreach $c1 (@whatlist)
-           {
-               foreach $c2 ('alias', 'triplet')
-               {
-                   $output_rules .= "\t\@echo 'set ${c1}_${c2} \$(${c1}_${c2})' >> \$\@-t\n";
-               }
-           }
+        $output_rules .= ("\t\@echo '## All variables above are generated by configure. Do Not Edit ##' >> \$\@-t\n"
+                          . "\t\@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> \$\@-t\n"
+                          . "\t\@test ! -f site.exp || mv site.exp site.bak\n"
+                          . "\t\@mv \$\@-t site.exp\n");
+    }
+}
 
-           $output_rules .= ("\t\@echo '## All variables above are generated by configure. Do Not Edit ##' >> \$\@-t\n"
-                             . "\t\@test ! -f site.exp || sed '1,/^## All variables above are.*##/ d' site.exp >> \$\@-t\n"
-                             . "\t\@test ! -f site.exp || mv site.exp site.bak\n"
-                             . "\t\@mv \$\@-t site.exp\n");
-       }
+
+# Handle TESTS variable and other checks.
+sub handle_tests
+{
+    if (defined $options{'dejagnu'})
+    {
+        &handle_tests_dejagnu;
     }
     else
     {