* 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>
+
+ * 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...
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
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
$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.
{
$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};
& $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'})
{
}
}
- 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.
--- /dev/null
+## 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%
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