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.
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');
$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;
}
{
# 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);
## 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
## 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
## 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:
## 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: