]> sourceware.org Git - automake.git/commitdiff
* lib/am/distdir.am (top_distdir, distdir): Define these
authorAlexandre Duret-Lutz <adl@gnu.org>
Tue, 21 Jan 2003 18:02:32 +0000 (18:02 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Tue, 21 Jan 2003 18:02:32 +0000 (18:02 +0000)
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).

ChangeLog
NEWS
automake.in
automake.texi
lib/am/distdir.am
stamp-vti
tests/subpkg.test
version.texi

index 5b5e76650daea52f61ed5ab720d57d54e54e4681..ebf74360cab1e78cf8776d48f12c36b543c09999 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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
diff --git a/NEWS b/NEWS
index e1c9e2d0709872f9c90e9dfe31247e79f4bb875e..19a01caea9dc0c9550e48dc40939caa1c620dde2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,10 @@
 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
index f5995965b3edff7c542b2fe3e278960b043fc19d..6086e0040d7d697f418128f84ecf7a4471e019c9 100755 (executable)
@@ -4175,10 +4175,6 @@ sub handle_dist
       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);
index 49505d5b371e651d140eec3a715cbe50e1ac0b56..b67020891aa8a1e954e30119398c8b968020afce 100644 (file)
@@ -4371,9 +4371,18 @@ entire directory will be recursively copied into the distribution.
 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
@@ -4398,25 +4407,6 @@ nodist_foo_SOURCES = do-not-distribute.c
 
 @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
@@ -4431,6 +4421,39 @@ dist-hook:
         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
index bc503147d128451fb0fc61c3611b379d9d5a2514..f4a26ef6a8860743e254830b77cb31288fca5463 100644 (file)
@@ -1,5 +1,5 @@
 ## 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 {} ';' \
@@ -157,13 +152,13 @@ endif %?TOPDIR_P%
 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; \
index 4aceec33a3d311309fa519c6a1d8b118cd8249fa..ce00591628fbd5cadf77153c8f4276d4a01d71bf 100644 (file)
--- a/stamp-vti
+++ b/stamp-vti
@@ -1,4 +1,4 @@
-@set UPDATED 19 January 2003
+@set UPDATED 21 January 2003
 @set UPDATED-MONTH January 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
index d2ed1020065225d0c65d9064563a641c55d472d4..84b23067612f75e58b58a2176b350b2dd71055bc 100755 (executable)
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -36,6 +36,14 @@ SUBDIRS = lib
 # 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'
@@ -63,6 +71,12 @@ 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'
@@ -84,3 +98,4 @@ cd ..
 
 ./configure
 $MAKE distcheck
+test -f subpack-1.tar.gz
index 4aceec33a3d311309fa519c6a1d8b118cd8249fa..ce00591628fbd5cadf77153c8f4276d4a01d71bf 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 19 January 2003
+@set UPDATED 21 January 2003
 @set UPDATED-MONTH January 2003
 @set EDITION 1.7a
 @set VERSION 1.7a
This page took 0.060168 seconds and 5 git commands to generate.