* tests/Makefile.am (TESTS): Added pr224.test.
* tests/pr224.test: New file.
* lib/depcomp: Fixed computation of depfile.
* lib/am/depend2.am: Use %DEPBASE%, not $(DEPDIR).
* automake.in (handle_single_transform_list): Only reject `..'
component for Java. Put dependencies in directory near object.
(handle_languages): Set DEPBASE. Handle de-ansi-fication.
+2002-01-20 Tom Tromey <tromey@redhat.com>
+
+ For PR automake/224:
+ * tests/Makefile.am (TESTS): Added pr224.test.
+ * tests/pr224.test: New file.
+ * lib/depcomp: Fixed computation of depfile.
+ * lib/am/depend2.am: Use %DEPBASE%, not $(DEPDIR).
+ * automake.in (handle_single_transform_list): Only reject `..'
+ component for Java. Put dependencies in directory near object.
+ (handle_languages): Set DEPBASE. Handle de-ansi-fication.
+
2002-01-20 Alexandre Duret-Lutz <duret_g@epita.fr>
* tests/defs: Export AUTOMAKE and ACLOCAL.
'DERIVED-EXT' => $der_ext,
+ # In this situation we know that the
+ # object is in this directory, so
+ # $(DEPDIR) is the correct location for
+ # dependencies.
+ 'DEPBASE' => '$(DEPDIR)/$*',
'BASE' => '$*',
'SOURCE' => '$<',
'OBJ' => '$@',
{
my ($derived, $source, $obj, $myext) = split (' ', $file);
+ # For any specially-generated object, we must respect the
+ # ansi2knr setting so that we don't inadvertently try to
+ # use the default rule.
+ if ($lang->ansi && defined $options{'ansi2knr'})
+ {
+ $myext = '$U' . $myext;
+ }
+
# We might see a given object twice, for instance if it is
# used under different conditions.
next if defined $seen_files{$obj};
# We _need_ `-o' for per object rules.
my $output_flag = $lang->output_flag || '-o';
+ my $depbase = dirname ($obj);
+ $depbase = ''
+ if $depbase eq '.';
+ $depbase .= '/'
+ unless $depbase eq '';
+ $depbase .= '$(DEPDIR)/' . basename ($obj);
+
# Generate a transform which will turn suffix targets in
# depend2.am into real targets for the particular objects we
# are building.
(%transform,
'GENERIC' => 0,
+ 'DEPBASE' => $depbase,
'BASE' => $obj,
'SOURCE' => $source,
# Use $myext and not `.o' here, in case
# FIXME: check that $DIRECTORY is somewhere in the
# project
- # We don't allow `..' in object file names for
- # *any* source, not just Java. For Java it just
- # doesn't make sense, but in general it is
- # a problem because we can't pick a good name for
- # the .deps entry.
- if ($object =~ /(\/|^)\.\.\//)
+ # For Java, the way we're handling it right now, a
+ # `..' component doesn't make sense.
+ if ($lang->name eq 'java' && $object =~ /(\/|^)\.\.\//)
{
am_error ("`$full' contains `..' component but should not");
}
# If we're generating dependencies, we also want
# to make sure that the appropriate subdir of the
# .deps directory is created.
- push (@dep_list, require_build_directory ('$(DEPDIR)/' . $directory))
- if ($use_dependencies);
+ push (@dep_list,
+ require_build_directory ($directory . '/$(DEPDIR)'))
+ if $use_dependencies;
}
&pretty_print_rule ($object . ':', "\t", @dep_list)
my $depfile = $object;
$depfile =~ s/\.([^.]*)$/.P$1/;
$depfile =~ s/\$\(OBJEXT\)$/o/;
- $dep_files{'$(DEPDIR)/' . $depfile} = 1;
+ $dep_files{dirname ($depfile) . '/$(DEPDIR)/'
+ . basename ($depfile)} = 1;
}
}
@page
@vskip 0pt plus 1filll
-Copyright @copyright{} 1995, 1996, 2000, 2001 Free Software Foundation, Inc.
+Copyright @copyright{} 1995, 1996, 2000, 2001, 2002 Free Software Foundation, Inc.
@sp 2
This is the first edition of the GNU Automake documentation,@*
and is consistent with GNU Automake @value{VERSION}.@*
Adds @samp{--with-regex} to the @code{configure} command line. If
specified (the default), then the @samp{regex} regular expression
library is used, @file{regex.o} is put into @samp{LIBOBJS}, and
-@samp{WITH_REGEX} is defined.. If @samp{--without-regex} is given, then
+@samp{WITH_REGEX} is defined. If @samp{--without-regex} is given, then
the @samp{rx} regular expression library is used, and @file{rx.o} is put
into @samp{LIBOBJS}.
## 02111-1307, USA.
## This file is read several times:
-## - once per *extention* (not per language) for generic compilation rules
+## - once per *extension* (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:
?!GENERIC?%OBJ%: %SOURCE%
if %AMDEP%
source='%SOURCE%' object='%OBJ%' libtool=no @AMDEPBACKSLASH@
- depfile='$(DEPDIR)/%BASE%.Po' tmpdepfile='$(DEPDIR)/%BASE%.TPo' @AMDEPBACKSLASH@
+ depfile='%DEPBASE%.Po' tmpdepfile='%DEPBASE%.TPo' @AMDEPBACKSLASH@
$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
?-o? %COMPILE% %-c% %-o% %OBJ% `test -f %SOURCE% || echo '$(srcdir)/'`%SOURCE%
?!GENERIC?%OBJOBJ%: %SOURCE%
if %AMDEP%
source='%SOURCE%' object='%OBJOBJ%' libtool=no @AMDEPBACKSLASH@
- depfile='$(DEPDIR)/%BASE%.Po' tmpdepfile='$(DEPDIR)/%BASE%.TPo' @AMDEPBACKSLASH@
+ depfile='%DEPBASE%.Po' tmpdepfile='%DEPBASE%.TPo' @AMDEPBACKSLASH@
$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
?-o? %COMPILE% %-c% %-o% %OBJOBJ% `cygpath -w %SOURCE%`
?!GENERIC?%LTOBJ%: %SOURCE%
if %AMDEP%
source='%SOURCE%' object='%LTOBJ%' libtool=yes @AMDEPBACKSLASH@
- depfile='$(DEPDIR)/%BASE%.Plo' tmpdepfile='$(DEPDIR)/%BASE%.TPlo' @AMDEPBACKSLASH@
+ depfile='%DEPBASE%.Plo' tmpdepfile='%DEPBASE%.TPlo' @AMDEPBACKSLASH@
$(%FPFX%DEPMODE) $(depcomp) @AMDEPBACKSLASH@
endif %AMDEP%
## We can always use `-o' with Libtool.
fi
# `libtool' can also be set to `yes' or `no'.
-depfile=${depfile-`echo "$object" | sed 's,\([^/]*\)$,.deps/\1,;s/\.\([^.]*\)$/.P\1/'`}
+if test -z "$depfile"; then
+ base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
+ dir=`echo "$object" | sed 's,/.*$,/,'`
+ if test "$dir" = "$object"; then
+ dir=
+ fi
+ # FIXME: should be _deps on DOS.
+ depfile="$dir.deps/$base"
+fi
+
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
-@set UPDATED 9 January 2002
+@set UPDATED 20 January 2002
@set UPDATED-MONTH January 2002
@set EDITION 1.5c
@set VERSION 1.5c
pr204.test \
pr211.test \
pr220.test \
+pr224.test \
pr229.test \
pr243.test \
pr266.test \
pr204.test \
pr211.test \
pr220.test \
+pr224.test \
pr229.test \
pr243.test \
pr266.test \
--- /dev/null
+#! /bin/sh
+
+# Test for $(top_srcdir) with dependencies.
+
+required=gcc
+. $srcdir/defs || exit 1
+
+mkdir foo
+
+cat >foo/main.c <<'EOF'
+int main() { return 0; }
+EOF
+
+cat >Makefile.am <<'EOF'
+AUTOMAKE_OPTIONS = subdir-objects
+bin_PROGRAMS = bar
+bar_SOURCES = foo/main.c
+EOF
+
+cat >configure.in <<'EOF'
+AC_INIT(foo/main.c)
+AC_CONFIG_AUX_DIR(.)
+AM_INIT_AUTOMAKE(test_am, 1.0)
+AC_PROG_CC
+AM_PROG_CC_C_O
+AC_OUTPUT(Makefile)
+EOF
+
+touch README NEWS AUTHORS ChangeLog
+
+mkdir build
+
+set -e
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+cd build
+CC='gcc' ../configure
+$MAKE
+
+test -d foo/.deps
-@set UPDATED 9 January 2002
+@set UPDATED 20 January 2002
@set UPDATED-MONTH January 2002
@set EDITION 1.5c
@set VERSION 1.5c