+2003-01-21 Alexandre Duret-Lutz <adl@gnu.org>
+
+ * lib/am/distdir.am (top_distdir, distdir): Define these
+ variables only in top level Makefile. Redefine $(top_distdir)
+ as $(distdir).
+ (distdir): Fix passing of $(top_distdir) to sub-makes.
+ * automake.in (handle_dist): Do not define the DISTDIR and
+ TOP_DISTDIR transformations. We don't need them anymore.
+ * automake.texi (Dist): Reorder the dist-hook section, and move
+ the DIST_SUBDIRS paragraph earlier. Document distdir and
+ top_distdir.
+ * tests/subpkg.test: Update to check for $(distdir) and
+ $(top_distdir).
+
2003-01-19 Alexandre Duret-Lutz <adl@gnu.org>
Rename more files to accomodate 8+3 file systems, and adjust the
New in 1.7a:
+* Cleanup the definitions of $(distdir) and $(top_distdir).
+ $(top_distdir) now points to the root of the distribution directory
+ created during `make dist', as it did in Automake 1.4, not to the
+ root of the build tree as it did in intervening versions.
+ Furthermore these two variables are now only defined in the top
+ level Makefile, and passed to sub-directories when running `make dist'.
* elisp sources are compiled all at once, instead of one by one.
This allows interdependencies and speed up compilation.
* AM_PROG_CC_STDC is now empty. The content of this macro was
if &target_defined ('dist-hook');
$transform{'DIST-TARGETS'} = join(' ', @dist_targets);
- # Defining $(DISTDIR).
- $transform{'DISTDIR'} = !variable_defined('distdir');
- $transform{'TOP_DISTDIR'} = backname ($relative_dir);
-
$output_rules .= &file_contents ('distdir',
new Automake::Location,
%transform);
Please note that this will also copy @emph{everything} in the directory,
including CVS/RCS version control files. We recommend against using
this feature.
-
@vindex EXTRA_DIST
+If you define @code{SUBDIRS}, Automake will recursively include the
+subdirectories in the distribution. If @code{SUBDIRS} is defined
+conditionally (@pxref{Conditionals}), Automake will normally include all
+directories that could possibly appear in @code{SUBDIRS} in the
+distribution. If you need to specify the set of directories
+conditionally, you can set the variable @code{DIST_SUBDIRS} to the exact
+list of subdirectories to include in the distribution (@pxref{Top level}).
+@vindex DIST_SUBDIRS
+
+
@section Fine-grained distribution control
Sometimes you need tighter control over what does @emph{not} go into the
@section The dist hook
-Another way to to use this is for removing unnecessary files that get
-recursively included by specifying a directory in EXTRA_DIST:
-
-@example
-EXTRA_DIST = doc
-
-dist-hook:
- rm -rf `find $(distdir)/doc -name CVS`
-@end example
-
-If you define @code{SUBDIRS}, Automake will recursively include the
-subdirectories in the distribution. If @code{SUBDIRS} is defined
-conditionally (@pxref{Conditionals}), Automake will normally include all
-directories that could possibly appear in @code{SUBDIRS} in the
-distribution. If you need to specify the set of directories
-conditionally, you can set the variable @code{DIST_SUBDIRS} to the exact
-list of subdirectories to include in the distribution.
-@vindex DIST_SUBDIRS
-
@trindex dist-hook
Occasionally it is useful to be able to change the distribution before
cp -p $(srcdir)/random/a1 $(srcdir)/random/a2 $(distdir)/random
@end example
+Another way to to use this is for removing unnecessary files that get
+recursively included by specifying a directory in EXTRA_DIST:
+
+@example
+EXTRA_DIST = doc
+
+dist-hook:
+ rm -rf `find $(distdir)/doc -name CVS`
+@end example
+
+@vindex distdir
+@vindex top_distdir
+Two variables that come handy when writting @code{dist-hook} targets are
+@code{$(distdir)} and @code{$(top_distdir)}.
+
+@code{$(distdir)} points to the directory where the @code{dist} target
+will copy files from the current directory before creating the
+tarball. If you are at the top-level directory, then @code{distdir =
+$(PACKAGE)-$(VERSION)}. When used from subdirectory named
+@file{foo/}, then @code{distdir = ../$(PACKAGE)-$(VERSION)/foo}.
+
+@code{$(top_distdir)} always points to the root directory of the
+distributed tree. At the top-level it's equal to @code{$(distdir)}.
+In the @file{foo/} subdirectory
+@code{top_distdir = ../$(PACKAGE)-$(VERSION)}.
+
+Note that when packages are nested using @code{AC_CONFIG_SUBDIRS}
+(@pxref{Subdirectories, AC_CONFIG_SUBDIRS, Configuring Other Packages
+in Subdirectories, autoconf, The Autoconf Manual}), then
+@code{$(distdir)} and @code{$(top_distdir)} are relative to the
+package where @code{make dist} was run, not to any sub-packages
+involved.
+
@section Checking the distribution
@cindex make distcheck
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003 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
## DIST_COMMON comes first so that README can be the very first file.
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-top_distdir = %TOP_DISTDIR%
if %?TOPDIR_P%
-## Avoid unsightly `./'.
-?DISTDIR?distdir = $(PACKAGE)-$(VERSION)
-else !%?TOPDIR_P%
-?DISTDIR?distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-endif !%?TOPDIR_P%
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
-if %?TOPDIR_P%
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
if %?SUBDIRS%
list='$(%DIST_SUBDIR_NAME%)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
+ test -d "$(distdir)/$$subdir" \
+ || mkdir "$(distdir)/$$subdir" \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="$(top_distdir)" \
- distdir=../$(distdir)/$$subdir \
+ top_distdir="../$(top_distdir)" \
+ distdir="../$(distdir)/$$subdir" \
distdir) \
|| exit 1; \
fi; \
-@set UPDATED 19 January 2003
+@set UPDATED 21 January 2003
@set UPDATED-MONTH January 2003
@set EDITION 1.7a
@set VERSION 1.7a
#! /bin/sh
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
#
# This file is part of GNU Automake.
#
# Yes, This program is named LDADD. So what?
bin_PROGRAMS = LDADD
LDADD_LDADD = lib/liblib.a
+
+# It's ok to override distdir.
+distdir = subpack-1
+
+# Make sure $(distdir) and $(top_distdir) work as expected.
+dist-hook:
+ test -f $(distdir)/LDADD.c
+ test -f $(top_distdir)/LDADD.c
EOF
cat >LDADD.c <<'EOF'
cat >lib/Makefile.am <<'EOF'
noinst_LIBRARIES = liblib.a
liblib_a_SOURCES = src/x.c
+
+dist-hook:
+ test ! -f $(distdir)/LDADD.c
+ test -f $(top_distdir)/LDADD.c
+ test -f $(distdir)/src/x.c
+ test ! -f $(top_distdir)/src/x.c
EOF
cat >lib/src/x.c <<'EOF'
./configure
$MAKE distcheck
+test -f subpack-1.tar.gz
-@set UPDATED 19 January 2003
+@set UPDATED 21 January 2003
@set UPDATED-MONTH January 2003
@set EDITION 1.7a
@set VERSION 1.7a