]> sourceware.org Git - automake.git/commitdiff
* ext-compile.am: New file.
authorAkim Demaille <akim@epita.fr>
Mon, 9 Apr 2001 14:56:27 +0000 (14:56 +0000)
committerAkim Demaille <akim@epita.fr>
Mon, 9 Apr 2001 14:56:27 +0000 (14:56 +0000)
* automake.in (&finish_languages): Output it.
Require a C linker if there are several registered source suffixes.
(&handle_compile): No longer push the `.c', `.o', `.obj', `.lo'
extensions, which are discovered in ext-compile.am.
With the help from Robert Boehne.

ChangeLog
Makefile.am
Makefile.in
automake.in
ext-compile.am [new file with mode: 0644]
lib/am/Makefile.am

index 25721a192c0237d876d0a4fbb8ef3a745cf49635..bff8d79e9db2b5e05ee75886da30c02fdb93d45e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-04-09  Akim Demaille  <akim@epita.fr>
+
+       * ext-compile.am: New file.
+       * automake.in (&finish_languages): Output it.
+       Require a C linker if there are several registered source suffixes.
+       (&handle_compile): No longer push the `.c', `.o', `.obj', `.lo'
+       extensions, which are discovered in ext-compile.am.
+       With the help from Robert Boehne.
+
 2001-04-09  Akim Demaille  <akim@epita.fr>
 
        * automake.in (&handle_compile): Extract from...
index 33c4abfb7cf9af5027eaa357ec0af482e475634a..26ed9c11a4fc9c43503f5f631b02c71acfbf1627 100644 (file)
@@ -12,8 +12,8 @@ info_TEXINFOS = automake.texi
 
 amfiles = ansi2knr.am check.am clean-hdr.am clean.am compile.am \
 configure.am data.am dejagnu.am depend.am depend2.am distdir.am \
-footer.am header-vars.am header.am install.am java.am lex.am \
-library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
+ext-compile.am footer.am header-vars.am header.am install.am java.am \
+lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
 mans-vars.am mans.am multilib.am program.am progs.am python.am \
 remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \
 texinfos.am yacc.am
index df1566f408bb837e1cfa159823b46fcf6b5c0480..e18e2ea3365e57acd12440a7a4a3875321d88875 100644 (file)
@@ -85,8 +85,8 @@ info_TEXINFOS = automake.texi
 
 amfiles = ansi2knr.am check.am clean-hdr.am clean.am compile.am \
 configure.am data.am dejagnu.am depend.am depend2.am distdir.am \
-footer.am header-vars.am header.am install.am java.am lex.am \
-library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
+ext-compile.am footer.am header-vars.am header.am install.am java.am \
+lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
 mans-vars.am mans.am multilib.am program.am progs.am python.am \
 remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \
 texinfos.am yacc.am
index 58df05e6686151fa09f27a453b1aecd918c29787..9f21b48e186a2ef8e031a500236dd2313b2d5307 100755 (executable)
@@ -1265,6 +1265,7 @@ sub finish_languages
            $comp = $language_map{"$lang-compile"};
 
            my $outarg = $language_map{"$lang-output-arg"};
+           my $ltoutarg;
            if ($language_map{"$lang-flags"} eq 'CFLAGS')
            {
                # C compilers don't always support -c -o.
@@ -1272,32 +1273,17 @@ sub finish_languages
                {
                    $outarg .= ' -o $@';
                }
+               # We can always use -c -o with libtool.
+               $ltoutarg = ' -o $@';
            }
 
-           my $full = ("\t\$("
-                       . $language_map{"$lang-compiler-name"}
-                       . ") "
-                       . $outarg);
-           $output_rules .= (".$ext.o:\n"
-                             . $full
-                             . " \$<\n");
-           # FIXME: Using cygpath should be somehow conditional.
-           $output_rules .= (".$ext.obj:\n"
-                             . $full
-                             . " `cygpath -w \$<`\n");
-           $output_rules .= (".$ext.lo:\n"
-                             . "\t\$(LT"
-                             . $language_map{"$lang-compiler-name"}
-                             . ") "
-                             . $language_map{"$lang-output-arg"}
-                             # We can always use -c -o with libtool.
-                             . ($language_map{"$lang-flags"} eq 'CFLAGS'
-                                ? ' -o $@' : '')
-                             . " \$<\n")
-               if $seen_libtool;
-       }
-
-       push (@suffixes, '.' . $ext);
+           my $compiler = $language_map{"$lang-compiler-name"};
+           $output_rules .= file_contents ('ext-compile',
+                                           ('EXT'      => $ext,
+                                            'COMPILER' => $compiler,
+                                            'OUTARG'   => $outarg,
+                                            'LTOUTARG' => $ltoutarg));
+       }
 
        # The rest of the loop is done once per language.
        next if defined $done{$lang};
@@ -1328,10 +1314,10 @@ sub finish_languages
        & $name ();
     }
 
-    # If the project is entirely C++ or entirely Fortran 77, don't
-    # bother with the C stuff.  But if anything else creeps in, then use
-    # it.
-    if ($need_link || ! $non_c || scalar keys %suffix_rules > 0)
+    # If the project is entirely C++ or entirely Fortran 77 (i.e., 1
+    # suffix rule was learned), don't bother with the C stuff.  But if
+    # anything else creeps in, then use it.
+    if ($need_link || ! $non_c || scalar keys %suffix_rules > 1)
     {
        if (! defined $done{'c'})
        {
@@ -1996,14 +1982,10 @@ sub handle_compile ()
          }
       }
 
-    push (@suffixes, '.c', '.o', '.obj');
-
     if ($seen_libtool)
       {
        # Output the libtool compilation rules.
        $output_rules .= &file_contents ('libtool');
-
-       push (@suffixes, '.lo');
       }
 
     # Check for automatic de-ANSI-fication.
diff --git a/ext-compile.am b/ext-compile.am
new file mode 100644 (file)
index 0000000..329939f
--- /dev/null
@@ -0,0 +1,33 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright 2001 Free Software Foundation, Inc.
+
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2, or (at your option)
+## any later version.
+
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+## 02111-1307, USA.
+
+## OUTARG is set to `', or `-c', or `-c -o $@' etc.
+## LTOUTARG is set to `', or `-o $@'.
+
+.%EXT%.o:
+       $(%COMPILER%) %OUTARG% $<
+
+.%EXT%.obj:
+## FIXME: Using cygpath should be somehow conditional.
+       $(%COMPILER%) %OUTARG% `cygpath -w $<`
+
+if %?LIBTOOL%
+.%EXT%.lo:
+## We don't care if there are several `-o', libtool handles it gracefully.
+       $(LT%COMPILER%) %OUTARG% %LTOUTARG% $<
+endif %?LIBTOOL%
index 33c4abfb7cf9af5027eaa357ec0af482e475634a..26ed9c11a4fc9c43503f5f631b02c71acfbf1627 100644 (file)
@@ -12,8 +12,8 @@ info_TEXINFOS = automake.texi
 
 amfiles = ansi2knr.am check.am clean-hdr.am clean.am compile.am \
 configure.am data.am dejagnu.am depend.am depend2.am distdir.am \
-footer.am header-vars.am header.am install.am java.am lex.am \
-library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
+ext-compile.am footer.am header-vars.am header.am install.am java.am \
+lex.am library.am libs.am libtool.am lisp.am ltlib.am ltlibrary.am \
 mans-vars.am mans.am multilib.am program.am progs.am python.am \
 remake-hdr.am scripts.am subdirs.am tags.am texi-vers.am texibuild.am \
 texinfos.am yacc.am
This page took 0.052451 seconds and 5 git commands to generate.