]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
dependency fixes from alexandre oliva
authorTom Tromey <tromey@redhat.com>
Mon, 23 Feb 1998 23:49:39 +0000 (23:49 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 23 Feb 1998 23:49:39 +0000 (23:49 +0000)
ChangeLog
automake.in
depend2.am
lib/am/depend2.am
lib/am/libtool.am
libtool.am

index 3f3a2a881d46f65e6e983fa69ebab01d0a297693..cb698488c4d142dbd387d43e6417780131a608f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 Mon Feb 23 13:38:56 1998  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (get_object_extension): Remove .c.lo rule from
+       libtool when dependencies turned on.
+       * libtool.am (.c.lo): Disable when dependency checking turned on.
+
+       Dependency fixes from Alexandre Oliva:
+       * automake.in (handle_dependencies): Fixed quoting when
+       substituting @PFX@ and @EXT@.  Don't look for the `.P' file.
+       * depend2.am (%.o): Use @PFX@ and @EXT@.
+       (%.lo): New rule.
+
        * texinfos.am (.txi.info, .txi.dvi, .txi): New rules.
        * automake.in (handle_texinfo): Recognize .txi files.  From Karl
        Berry.
index 47ef8167e14d046ad5b0ca43a7ffaacf21030c9c..0a557d79a4ed65cf99ef8c21bee146d5a1b3bc6a 100755 (executable)
@@ -774,7 +774,11 @@ sub get_object_extension
     if ($seen_libtool && ! $included_libtool_compile)
     {
        # Output the libtool compilation rules.
-       $output_rules .= &file_contents ('libtool');
+       $output_rules .=
+           &file_contents_with_transform
+               ($use_dependencies ? 's/^NOTDEPEND.*$//;' : 's/^NOTDEPEND//;',
+                'libtool');
+
        &push_phony_cleaners ('libtool');
 
        push (@suffixes, '.lo');
@@ -2770,21 +2774,17 @@ sub handle_dependencies
            $output_rules .= &file_contents ('depend');
            push (@clean, 'depend');
            &push_phony_cleaners ('depend');
-           # FIXME: should use @EXT@ and @PFX@.  I don't know why it
-           # didn't work.
            $output_rules .=
-               &file_contents_with_transform ('s/EXT/.c/g;'
-                                              . 's/PFX//g;',
+               &file_contents_with_transform ('s/\@EXT\@/.c/g;'
+                                              . 's/\@PFX\@//g;',
                                               'depend2');
            local ($ext);
            local ($need_cxx) = 0;
            foreach $ext (sort keys %cxx_extensions)
            {
-               # FIXME: should use @EXT@ and @PFX@.  I don't know why
-               # it didn't work.
                $output_rules .=
-                   &file_contents_with_transform ('s/EXT/' . $ext .'/g;'
-                                                  . 's/PFX/CXX/g;',
+                   &file_contents_with_transform ('s/\@EXT\@/' . $ext .'/g;'
+                                                  . 's/\@PFX\@/CXX/g;',
                                                   'depend2');
                $need_cxx = 1;
            }
@@ -2798,8 +2798,7 @@ sub handle_dependencies
     {
        # Include any auto-generated deps that are present.  Note that
        # $build_directory ends in a "/".
-       if (-d ($build_directory . $relative_dir . "/.deps")
-           && -f ($build_directory . $relative_dir . "/.deps/.P"))
+       if (-d ($build_directory . $relative_dir . "/.deps"))
        {
            local ($depfile);
 
index 48cdd18e4e8b1671bededa9beb5f584d3c256819..4048f26f2615265878b7c74c3460aa1e54b3a895 100644 (file)
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-## FIXME: should use @EXT@, but that didn't work.
-%.o: %EXT
-## FIXME: should use @PFX@, but that didn't work.
-       @echo '$(PFXCOMPILE) -c $<'; \
+%.o: %@EXT@
+       @echo '$(@PFX@COMPILE) -c $<'; \
        DEPENDENCIES_OUTPUT='.deps/$(*F).P'; \
        export DEPENDENCIES_OUTPUT; \
 ## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the
 ## named file.  So we truncate it explicitly.
        : > .deps/$(*F).P; \
-## FIXME: should use @PFX@, but that didn't work.
-       $(PFXCOMPILE) -c $<
+       $(@PFX@COMPILE) -c $<
+
+%.lo: %@EXT@
+       @echo '$(LT@PFX@COMPILE) -c $<'; \
+       DEPENDENCIES_OUTPUT='.deps/$(*F).p'; \
+       export DEPENDENCIES_OUTPUT; \
+## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the
+## named file.  So we truncate it explicitly.
+       : > .deps/$(*F).p; \
+       $(LT@PFX@COMPILE) -c $<
+       @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' < .deps/$(*F).p | \
+       $(AWK) '/:/ { ignore = ++ignoring[$$1]; } ignore == 1 { print }' \
+       > .deps/$(*F).P
+       @-rm -f .deps/$(*F).p
index 48cdd18e4e8b1671bededa9beb5f584d3c256819..4048f26f2615265878b7c74c3460aa1e54b3a895 100644 (file)
 ## along with this program; if not, write to the Free Software
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
-## FIXME: should use @EXT@, but that didn't work.
-%.o: %EXT
-## FIXME: should use @PFX@, but that didn't work.
-       @echo '$(PFXCOMPILE) -c $<'; \
+%.o: %@EXT@
+       @echo '$(@PFX@COMPILE) -c $<'; \
        DEPENDENCIES_OUTPUT='.deps/$(*F).P'; \
        export DEPENDENCIES_OUTPUT; \
 ## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the
 ## named file.  So we truncate it explicitly.
        : > .deps/$(*F).P; \
-## FIXME: should use @PFX@, but that didn't work.
-       $(PFXCOMPILE) -c $<
+       $(@PFX@COMPILE) -c $<
+
+%.lo: %@EXT@
+       @echo '$(LT@PFX@COMPILE) -c $<'; \
+       DEPENDENCIES_OUTPUT='.deps/$(*F).p'; \
+       export DEPENDENCIES_OUTPUT; \
+## Note that using DEPENDENCIES_OUTPUT causes gcc to append to the
+## named file.  So we truncate it explicitly.
+       : > .deps/$(*F).p; \
+       $(LT@PFX@COMPILE) -c $<
+       @-sed -e 's/^\([^:]*\)\.o:/\1.lo \1.o:/' < .deps/$(*F).p | \
+       $(AWK) '/:/ { ignore = ++ignoring[$$1]; } ignore == 1 { print }' \
+       > .deps/$(*F).P
+       @-rm -f .deps/$(*F).p
index c4a3b159ce027427eefc0d18480b08f3dd7d184b..e748cc733becb508b5e4f41cf4ceff416a8adc80 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-.c.lo:
+NOTDEPEND.c.lo:
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
-       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+NOTDEPEND      $(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 ## These are just copies of the above rule.
 .s.lo:
index c4a3b159ce027427eefc0d18480b08f3dd7d184b..e748cc733becb508b5e4f41cf4ceff416a8adc80 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+## Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
-.c.lo:
+NOTDEPEND.c.lo:
 ## Note that we explicitly set the libtool mode.  This avoids any lossage
 ## if the program doesn't have a name that libtool expects.
-       $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+NOTDEPEND      $(LIBTOOL) --mode=compile $(COMPILE) -c $<
 
 ## These are just copies of the above rule.
 .s.lo: