From 85a2cee16282155e275784ce5a01af07106e19dd Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sun, 13 May 2001 17:19:18 +0000 Subject: [PATCH] * 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. --- ChangeLog | 9 ++++++++ Makefile.am | 4 ++-- Makefile.in | 4 ++-- automake.in | 27 +++++----------------- depend2.am | 16 +++++++------ java.am | 6 ++--- lang-compile.am | 52 ++++++++++++++++++++++++++++++++++++++++++ lib/am/Makefile.am | 4 ++-- lib/am/depend2.am | 16 +++++++------ lib/am/java.am | 6 ++--- lib/am/lang-compile.am | 52 ++++++++++++++++++++++++++++++++++++++++++ tests/Makefile.am | 2 +- tests/Makefile.in | 2 +- 13 files changed, 151 insertions(+), 49 deletions(-) create mode 100644 lang-compile.am create mode 100644 lib/am/lang-compile.am diff --git a/ChangeLog b/ChangeLog index 641e1bb0..392b3def 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-05-13 Akim Demaille + + * 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 * tests/Makefile.am (TESTS): Added python.test. diff --git a/Makefile.am b/Makefile.am index 5e6cc64a..2e1a2803 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 diff --git a/Makefile.in b/Makefile.in index fcc02a79..ad247d07 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 diff --git a/automake.in b/automake.in index f980d5f1..e403af85 100755 --- a/automake.in +++ b/automake.in @@ -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 diff --git a/depend2.am b/depend2.am index de90d5e9..4d8f09b2 100644 --- a/depend2.am +++ b/depend2.am @@ -18,15 +18,17 @@ ## 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 cbc7435b..3b814351 100644 --- 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 index 00000000..02def500 --- /dev/null +++ b/lang-compile.am @@ -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% diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am index 5e6cc64a..2e1a2803 100644 --- a/lib/am/Makefile.am +++ b/lib/am/Makefile.am @@ -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 diff --git a/lib/am/depend2.am b/lib/am/depend2.am index de90d5e9..4d8f09b2 100644 --- a/lib/am/depend2.am +++ b/lib/am/depend2.am @@ -18,15 +18,17 @@ ## 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/lib/am/java.am b/lib/am/java.am index cbc7435b..3b814351 100644 --- a/lib/am/java.am +++ b/lib/am/java.am @@ -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 index 00000000..02def500 --- /dev/null +++ b/lib/am/lang-compile.am @@ -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% diff --git a/tests/Makefile.am b/tests/Makefile.am index fc77fe1d..3d3ee783 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 \ diff --git a/tests/Makefile.in b/tests/Makefile.in index 4bb65ed9..2dc0ec00 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -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 \ -- 2.43.5