automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03-lang-compile-am.patch


From: Akim Demaille
Subject: 03-lang-compile-am.patch
Date: Sat, 12 May 2001 14:33:26 +0200

This finally fixes subobj2 (which was failing for the reason
completely different from what it was meant to test IMHO).

For uniformity, I must confess I'd like to see depend2.am renamed
ext-compile.am.

Tom, I realize I don't understand how Java is handled.  There are two
Javas?  On via gcj which is handled thanks to its extension, and
another one, via primaries, handled by java.am, right?  I was about to
move the JAVAC etc. things from java.am to lang-compile.am, but it
would be wrong, wouldn't it?


Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * 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.

Index: automake.in
--- automake.in Sat, 12 May 2001 10:49:12 +0200 akim (am/f/39_automake.i 
1.266.1.6 755)
+++ automake.in Sat, 12 May 2001 11:21:28 +0200 akim (am/f/39_automake.i 
1.266.1.6 755)
@@ -945,8 +945,7 @@ sub initialize_per_input ()
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
-                  'extensions' => ['F'],
-                  '_finish' => \&lang_ppf77_finish);
+                  'extensions' => ['F']);

 # Ratfor.
 register_language ('name' => 'ratfor',
@@ -963,8 +962,7 @@ sub initialize_per_input ()
                   'compile_flag' => '-c',
                   'output_flag' => '-o',
                   'pure' => 1,
-                  'extensions' => ['r'],
-                  '_finish' => \&lang_ratfor_finish);
+                  'extensions' => ['r']);

 # Java via gcj.
 # FIXME: for now we can't do dependency tracking for Java.
@@ -1601,6 +1599,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
@@ -5120,23 +5122,6 @@ sub lang_lex_finish
     {
        &yacc_lex_finish_helper;
     }
-}
-
-
-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");
 }


Index: depend2.am
--- depend2.am Wed, 09 May 2001 19:37:26 +0200 akim (am/g/43_depend2.am 1.16 
644)
+++ depend2.am Sat, 12 May 2001 11:14:12 +0200 akim (am/g/43_depend2.am 1.16 
644)
@@ -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%
Index: Makefile.am
--- Makefile.am Wed, 09 May 2001 19:37:26 +0200 akim (am/f/46_Makefile.a 1.24 
644)
+++ Makefile.am Sat, 12 May 2001 11:11:05 +0200 akim (am/f/46_Makefile.a 1.24 
644)
@@ -15,8 +15,8 @@

 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: Makefile.in
--- Makefile.in Wed, 09 May 2001 19:37:26 +0200 akim (am/h/16_Makefile.i 1.66 
644)
+++ Makefile.in Sat, 12 May 2001 11:11:11 +0200 akim (am/h/16_Makefile.i 1.66 
644)
@@ -84,8 +84,8 @@

 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: tests/Makefile.am
--- tests/Makefile.am Wed, 09 May 2001 19:37:26 +0200 akim (am/f/4_Makefile.a 
1.16 644)
+++ tests/Makefile.am Sat, 12 May 2001 11:24:01 +0200 akim (am/f/4_Makefile.a 
1.16 644)
@@ -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: tests/Makefile.in
--- tests/Makefile.in Wed, 09 May 2001 19:37:26 +0200 akim (am/h/14_Makefile.i 
1.45.1.1 644)
+++ tests/Makefile.in Sat, 12 May 2001 11:26:05 +0200 akim (am/h/14_Makefile.i 
1.45.1.1 644)
@@ -74,7 +74,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: lang-compile.am
--- lang-compile.am Sat, 12 May 2001 11:26:34 +0200 akim ()
+++ lang-compile.am Sat, 12 May 2001 11:19:49 +0200 akim (am/i/5_lang-compi  
644)
@@ -0,0 +1,44 @@
+## 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.
+
+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: java.am
--- java.am Wed, 09 May 2001 19:37:26 +0200 akim (am/g/36_java.am 1.12 644)
+++ java.am Sat, 12 May 2001 11:31:23 +0200 akim (am/g/36_java.am 1.12 644)
@@ -17,9 +17,9 @@
 ## 02111-1307, USA.


-## --------- ##
-## Bulding.  ##
-## --------- ##
+## ---------- ##
+## Building.  ##
+## ---------- ##

 JAVAC = javac
 JAVACFLAGS =
Index: lang-compile.am
--- lang-compile.am Sat, 12 May 2001 11:28:03 +0200 akim (am/i/5_lang-compi 1.1 
644)
+++ lang-compile.am Sat, 12 May 2001 11:31:37 +0200 akim (am/i/5_lang-compi 1.1 
644)
@@ -18,10 +18,17 @@

 ## 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.  ##
 ## ------------------------- ##
@@ -31,6 +38,7 @@
 .F.f:
        $(F77COMPILE) -F $<
 endif %?PPF77%
+


 ## -------- ##



reply via email to

[Prev in Thread] Current Thread [Next in Thread]