* lang-compile.am: New file, loaded once per language.
authorAkim Demaille <akim@epita.fr>
Sun, 13 May 2001 17:19:18 +0000 (17:19 +0000)
committerAkim Demaille <akim@epita.fr>
Sun, 13 May 2001 17:19:18 +0000 (17:19 +0000)
* depend2.am: Move definitions loaded once per language in the
aforementioned file.
* automake.in (&handle_languages): Load it.
(&lang_ppf77_finish, &lang_ratfor_finish): Remove as it's now
handled by lang-compile.am.

13 files changed:
ChangeLog
Makefile.am
Makefile.in
automake.in
depend2.am
java.am
lang-compile.am [new file with mode: 0644]
lib/am/Makefile.am
lib/am/depend2.am
lib/am/java.am
lib/am/lang-compile.am [new file with mode: 0644]
tests/Makefile.am
tests/Makefile.in

index 641e1bb..392b3de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-05-13  Akim Demaille  <akim@epita.fr>
+
+       * lang-compile.am: New file, loaded once per language.
+       * depend2.am: Move definitions loaded once per language in the
+       aforementioned file.
+       * automake.in (&handle_languages): Load it.
+       (&lang_ppf77_finish, &lang_ratfor_finish): Remove as it's now
+       handled by lang-compile.am.
+
 2001-05-13  Tom Tromey  <tromey@redhat.com>
 
        * tests/Makefile.am (TESTS): Added python.test.
index 5e6cc64..2e1a280 100644 (file)
@@ -15,8 +15,8 @@ amdir = $(pkgdatadir)/am
 
 dist_am_DATA = 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 \
+footer.am header-vars.am header.am install.am java.am lang-compile.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 fcc02a7..ad247d0 100644 (file)
@@ -84,8 +84,8 @@ amdir = $(pkgdatadir)/am
 
 dist_am_DATA = 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 \
+footer.am header-vars.am header.am install.am java.am lang-compile.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 f980d5f..e403af8 100755 (executable)
@@ -938,8 +938,7 @@ register_language ('name' => 'ppf77',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
-                  'extensions' => ['F'],
-                  '_finish' => \&lang_ppf77_finish);
+                  'extensions' => ['F']);
 
 # Ratfor.
 register_language ('name' => 'ratfor',
@@ -956,8 +955,7 @@ register_language ('name' => 'ratfor',
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
-                  'extensions' => ['r'],
-                  '_finish' => \&lang_ratfor_finish);
+                  'extensions' => ['r']);
 
 # Java via gcj.
 register_language ('name' => 'java',
@@ -1578,6 +1576,10 @@ sub handle_languages
        next if defined $done{$lang};
        $done{$lang} = 1;
 
+       # Load the language dependent Makefile chunks.
+       my %lang = map { uc ($_) => 0 } keys %languages;
+       $lang{uc ($lang->name)} = 1;
+       $output_rules .= file_contents ('lang-compile', %transform, %lang);
 
        # If the source to a program consists entirely of code from a
        # `pure' language, for instance C++ for Fortran 77, then we
@@ -5116,23 +5118,6 @@ sub lang_lex_finish
 }
 
 
-sub lang_ppf77_finish
-{
-    # We also handle the case of preprocessing `.F' files into `.f'
-    # files.
-    $output_rules .= (".F.f:\n"
-                     . "\t\$(F77COMPILE) -F \$<\n");
-}
-
-sub lang_ratfor_finish
-{
-    # We also handle the case of preprocessing `.r' files into `.f'
-    # files.
-    $output_rules .= (".r.f:\n"
-                     . "\t\$(RCOMPILE) -F \$<\n");
-}
-
-
 # Given a hash table of linker names, pick the name that has the most
 # precedence.  This is lame, but something has to have global
 # knowledge in order to eliminate the conflict.  Add more linkers as
index de90d5e..4d8f09b 100644 (file)
 ## 02111-1307, USA.
 
 ## This file is read several times:
-## - once per language for generic compilation rules
+## - once per *extention* (not per language) for generic compilation rules
 ## - once for each file which requires specific flags.
 
-## Note it is on purpose we wrote `if %AMDEP%', since %AMDEP% becomes
-## '@AMDEP_TRUE@' if dependencies are to be used, otherwise FALSE.
-
-if %AMDEP%
-?GENERIC?%FPFX%DEPMODE = @%FPFX%DEPMODE@
-endif %AMDEP%
+## Note it is on purpose we wrote `if %AMDEP%', since:
+##
+## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
+##   the `if FALSE' chunk is removed (automake-time conditionals).
+##
+## - if deps are on, %AMDEP% is mapped onto AMDEP,  and therefore
+##   the `if FALSE' chunk is prefix with @AMDEP_TRUE@ just like for any
+##   other configure-time conditional.
 
 ?GENERIC?.%EXT%.o:
 ?!GENERIC?%OBJ%: %SOURCE%
diff --git a/java.am b/java.am
index cbc7435..3b81435 100644 (file)
--- a/java.am
+++ b/java.am
@@ -17,9 +17,9 @@
 ## 02111-1307, USA.
 
 
-## --------- ##
-## Bulding.  ##
-## --------- ##
+## ---------- ##
+## Building.  ##
+## ---------- ##
 
 JAVAC = javac
 JAVACFLAGS =
diff --git a/lang-compile.am b/lang-compile.am
new file mode 100644 (file)
index 0000000..02def50
--- /dev/null
@@ -0,0 +1,52 @@
+## 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.
+
+## This file is read once per *language*, not per extension.
+
+## ----------------------------- ##
+## Common to all the languages.  ##
+## ----------------------------- ##
+
+## Dependency tracking.
+if %AMDEP%
+%FPFX%DEPMODE = @%FPFX%DEPMODE@
+endif %AMDEP%
+
+
+
+## ------------------------- ##
+## Preprocessed Fortran 77.  ##
+## ------------------------- ##
+
+## We also handle the case of preprocessing `.F' files into `.f' files.
+if %?PPF77%
+.F.f:
+       $(F77COMPILE) -F $<
+endif %?PPF77%
+
+
+
+## -------- ##
+## Ratfor.  ##
+## -------- ##
+
+## We also handle the case of preprocessing `.r' files into `.f' files.
+if %?RATFOR%
+.r.f:
+       $(RCOMPILE) -F $<
+endif %?RATFOR%
index 5e6cc64..2e1a280 100644 (file)
@@ -15,8 +15,8 @@ amdir = $(pkgdatadir)/am
 
 dist_am_DATA = 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 \
+footer.am header-vars.am header.am install.am java.am lang-compile.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 de90d5e..4d8f09b 100644 (file)
 ## 02111-1307, USA.
 
 ## This file is read several times:
-## - once per language for generic compilation rules
+## - once per *extention* (not per language) for generic compilation rules
 ## - once for each file which requires specific flags.
 
-## Note it is on purpose we wrote `if %AMDEP%', since %AMDEP% becomes
-## '@AMDEP_TRUE@' if dependencies are to be used, otherwise FALSE.
-
-if %AMDEP%
-?GENERIC?%FPFX%DEPMODE = @%FPFX%DEPMODE@
-endif %AMDEP%
+## Note it is on purpose we wrote `if %AMDEP%', since:
+##
+## - if deps are turned off, %AMDEP% is mapped onto FALSE, and therefore
+##   the `if FALSE' chunk is removed (automake-time conditionals).
+##
+## - if deps are on, %AMDEP% is mapped onto AMDEP,  and therefore
+##   the `if FALSE' chunk is prefix with @AMDEP_TRUE@ just like for any
+##   other configure-time conditional.
 
 ?GENERIC?.%EXT%.o:
 ?!GENERIC?%OBJ%: %SOURCE%
index cbc7435..3b81435 100644 (file)
@@ -17,9 +17,9 @@
 ## 02111-1307, USA.
 
 
-## --------- ##
-## Bulding.  ##
-## --------- ##
+## ---------- ##
+## Building.  ##
+## ---------- ##
 
 JAVAC = javac
 JAVACFLAGS =
diff --git a/lib/am/lang-compile.am b/lib/am/lang-compile.am
new file mode 100644 (file)
index 0000000..02def50
--- /dev/null
@@ -0,0 +1,52 @@
+## 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.
+
+## This file is read once per *language*, not per extension.
+
+## ----------------------------- ##
+## Common to all the languages.  ##
+## ----------------------------- ##
+
+## Dependency tracking.
+if %AMDEP%
+%FPFX%DEPMODE = @%FPFX%DEPMODE@
+endif %AMDEP%
+
+
+
+## ------------------------- ##
+## Preprocessed Fortran 77.  ##
+## ------------------------- ##
+
+## We also handle the case of preprocessing `.F' files into `.f' files.
+if %?PPF77%
+.F.f:
+       $(F77COMPILE) -F $<
+endif %?PPF77%
+
+
+
+## -------- ##
+## Ratfor.  ##
+## -------- ##
+
+## We also handle the case of preprocessing `.r' files into `.f' files.
+if %?RATFOR%
+.r.f:
+       $(RCOMPILE) -F $<
+endif %?RATFOR%
index fc77fe1..3d3ee78 100644 (file)
@@ -2,7 +2,7 @@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = subobj2.test yaccvpath.test texinfo10.test subdir5.test
+XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test
 
 TESTS =        \
 acinclude.test \
index 4bb65ed..2dc0ec0 100644 (file)
@@ -74,7 +74,7 @@ install_sh = @install_sh@
 
 AUTOMAKE_OPTIONS = gnits
 
-XFAIL_TESTS = subobj2.test yaccvpath.test texinfo10.test subdir5.test
+XFAIL_TESTS = yaccvpath.test texinfo10.test subdir5.test
 
 TESTS = \
 acinclude.test \