]> sourceware.org Git - automake.git/commitdiff
ansi2knr fixes
authorTom Tromey <tromey@redhat.com>
Sun, 27 Apr 1997 17:39:46 +0000 (17:39 +0000)
committerTom Tromey <tromey@redhat.com>
Sun, 27 Apr 1997 17:39:46 +0000 (17:39 +0000)
ChangeLog
automake.in
compile-kr.am
kr-extra.am

index 1c99086c85b4c7fcaba0dbc1af35281e62f2d241..676bd9ee69dfaa0dfc8714c14c92830096c87b0d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Sun Apr 27 11:03:36 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * automake.in (handle_yacc_lex_cxx): ._c and ._o files both depend
+       on $(ANSI2KNR).
+
+       * kr-extra.am (ansi2knr): Removed.
+       (ansi2knr.o): Likewise.
+
+       * automake.in (get_object_extension): Allow ansi2knr to be built
+       from any directory.
+
 Fri Apr 25 12:33:23 1997  Tom Tromey  <tromey@cygnus.com>
 
        * missing: Changed bison text.  From Ian Taylor.
index b3600d282dd14f363f2a8bc492a3d3ca3778f5cb..9b3b3ea0968385e3b74dc27246c4a4274bf95a0f 100755 (executable)
@@ -6,7 +6,7 @@ eval 'exec @PERL@ -S $0 ${1+"$@"}'
     if 0;
 
 # automake - create Makefile.in from Makefile.am
-# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997 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
@@ -748,17 +748,27 @@ sub get_object_extension
                &push_phony_cleaners ('krextra');
            }
 
+           # Generate rules to build ansi2knr.  If it is in some
+           # other directory, then generate dependencies but have the
+           # rule just run elsewhere.
+           $output_rules .= ($options{'ansi2knr'} . ': '
+                             . $options{'ansi2knr'} . ".o\n");
+           if ($options{'ansi2knr'} eq 'ansi2knr')
+           {
+               $output_rules .= ("\t\$(LINK) ansi2knr.o \$(LIBS)\n"
+                                 . "ansi2knr.o: \$(CONFIG_HEADER)\n\n");
+           }
+           else
+           {
+               $output_rules .= ("\tcd " . &dirname ($options{'ansi2knr'})
+                                 . " && \$(MAKE) ansi2knr\n\n");
+           }
+
            &define_variable ('o', "\@U\@o");
 
            # Make sure ansi2knr can be found: if no path specified,
            # specify "./".
-           local ($apath) = $options{'ansi2knr'};
-           if ($apath =~ /\//)
-           {
-               # Found in another directory.
-               &define_variable ("ANSI2KNR", $apath);
-           }
-           else
+           if ($options{'ansi2knr'} eq 'ansi2knr')
            {
                # Substitution from AM_C_PROTOTYPES.  This makes it be
                # built only when necessary.
@@ -766,6 +776,11 @@ sub get_object_extension
                # ansi2knr needs to be built before subdirs, so unshift it.
                unshift (@all, '$(ANSI2KNR)');
            }
+           else
+           {
+               # Found in another directory.
+               &define_variable ("ANSI2KNR", &dirname ($options{'ansi2knr'}));
+           }
 
            $output_rules .= &file_contents ('compile-kr');
            $output_rules .= &file_contents ('clean-kr');
@@ -897,7 +912,13 @@ sub handle_yacc_lex_cxx
     {
        # Make all ._o files depend on ansi2knr.  Use a sneaky little
        # hack to make it print nicely.
-       &pretty_print_rule ('', '', (sort keys %de_ansi_objects,
+       &pretty_print_rule ('', '', ((sort keys %de_ansi_objects),
+                                    ':', '$(ANSI2KNR)'));
+       # The ._c files also depend on ansi2knr.  We need both because
+       # some makes don't apply transitivity through implicit rules.
+       local (%de_ansi_sources);
+       grep (($de_ansi_sources{$_} = $_) =~ s/o$/c/, keys %de_ansi_objects);
+       &pretty_print_rule ('', '', ((sort keys %de_ansi_sources),
                                     ':', '$(ANSI2KNR)'));
     }
 
@@ -943,7 +964,7 @@ sub output_yacc_build_rule
        if ($use_interlock)
        {
            $output_rules .= ('$(SHELL) $(INTERLOCK) =yacclockdir $(YLWRAP)'
-                             . ' "$(YACC)" y.tab.c $*' . $suffix 
+                             . ' "$(YACC)" y.tab.c $*' . $suffix
                              . ' y.tab.h $*.h -- $(YFLAGS) $<');
        }
        else
@@ -967,9 +988,9 @@ sub output_lex_build_rule
     &define_configure_variable ('LEX_OUTPUT_ROOT');
     &define_configure_variable ('LEXLIB');
     $output_rules .= "$lex_suffix$c_suffix:\n\t";
-    
+
     if ($use_interlock)
-    { 
+    {
         # is the $@ correct here?  If so, why not use it in the
         # interlock build rule for yacc above?
        $output_rules .= '$(SHELL) $(INTERLOCK) =lexlockdir $(YLWRAP)'
@@ -1052,7 +1073,7 @@ sub handle_single_transform_list
            # distribution.  If the extension is the regular '.y' or
            # '.l', we assume C compilation, and the generated file
            # has exension .c.  Otherwise, we compile with C++, and
-           # make the following association: (yy -> cc, y++ -> c++, 
+           # make the following association: (yy -> cc, y++ -> c++,
            # yxx -> cxx), similarly for .ll, etc.
            if (/^(.*)\.(y|yy|y\+\+|yxx)$/)
            {
@@ -1921,7 +1942,8 @@ sub handle_texinfo
     # Find these programs wherever they may lie.  Yes, this has
     # intimate knowledge of the structure of the texinfo distribution.
     &define_program_variable ('MAKEINFO', 'build', 'texinfo/makeinfo',
-                             'makeinfo', '@MAKEINFO@');
+                             'makeinfo',
+                             '@MAKEINFO@');
     &define_program_variable ('TEXI2DVI', 'src', 'texinfo/util',
                              'texi2dvi');
 
index 86cecf9b61b9a9768bcc74b2e31f7eaa13a10e41..630ea751bdc5955375ddf9d64bcd37b7d9cc5d30 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1997 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
        @rm -f _$*.c
        @ln $< _$*.c && $(LIBTOOL) --mode=compile $(COMPILE) -c _$*.c && mv _$*.lo $@ && rm _$*.c
 
+## This rule exists because some versions of make won't apply
+## transitivity through implicit rules.
 .c._o:
        $(ANSI2KNR) $< > $*.tmp && mv $*.tmp $*._c
        @echo "$(COMPILE) -c $*._c"
        @rm -f _$*.c
        @ln $*._c _$*.c && $(COMPILE) -c _$*.c && mv _$*.o $@ && rm _$*.c
 
+## This rule exists because some versions of make won't apply
+## transitivity through implicit rules.
 .c.l_o:
        $(ANSI2KNR) $< > $*.tmp && mv $*.tmp $*._c
        @echo "$(LIBTOOL) --mode=compile $(COMPILE) -c $*._c"
index cf4fab40e8290480c51ecfa13ebf36968893ee5c..9dc539f3d1cff0a785f3cd2704bdfe2cb92e24fa 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1997 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
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-ansi2knr: ansi2knr.o
-       $(LINK) ansi2knr.o $(LIBS)
-
-ansi2knr.o: $(CONFIG_HEADER)
-
 mostlyclean-krextra:
 
 clean-krextra:
This page took 0.0464639999999999 seconds and 5 git commands to generate.