automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] [ng] dist: more verbatim inclusion of relevant makef


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] [ng] dist: more verbatim inclusion of relevant makefile fragments
Date: Sat, 11 Aug 2012 11:41:57 +0200

* lib/am/distdir.am: Move most of the '%?TOPDIR_P%'-protected, verbatim
stuff (i.e., containing no Automake-time transforms) from here ...
* lib/am/distcheck.mk: ... to here, with related adjustments.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/am/distcheck.mk | 67 ++++++++++++++++++++++++++++++++++++++++++++
 lib/am/distdir.am   | 81 -----------------------------------------------------
 2 files changed, 67 insertions(+), 81 deletions(-)

diff --git a/lib/am/distcheck.mk b/lib/am/distcheck.mk
index 3504dc0..2274039 100644
--- a/lib/am/distcheck.mk
+++ b/lib/am/distcheck.mk
@@ -11,6 +11,73 @@
 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ## GNU General Public License for more details.
 
+
+# ---------------------------------------- #
+#  Building various distribution flavors.  #
+# ---------------------------------------- #
+
+# Note that we don't use GNU tar's '-z' option.  One reason (but
+# not the only reason) is that some versions of tar (e.g., OSF1)
+# interpret '-z' differently.
+#
+# The -o option of GNU tar used to exclude empty directories.  This
+# behavior was fixed in tar 1.12 (released on 1997-04-25).  But older
+# versions of tar are still used (for instance NetBSD 1.6.1 ships
+# with tar 1.11.2).  We do not do anything specific w.r.t. this
+# incompatibility since packages where empty directories need to be
+# present in the archive are really unusual.
+#
+# We order DIST_TARGETS by expected duration of the compressors,
+# slowest first, for better parallelism in "make dist".  Do not
+# reorder DIST_ARCHIVES, users may expect gzip to be first.
+
+am.dist.ext.gzip  = tar.gz
+am.dist.ext.bzip2 = tar.bz2
+am.dist.ext.xz    = tar.xz
+am.dist.ext.lzip  = tar.lz
+am.dist.ext.zip   = zip
+
+DIST_TARGETS  = $(foreach x,$(am.dist.formats),dist-$x)
+DIST_ARCHIVES = $(foreach x,$(am.dist.formats),$(distdir).$(am.dist.ext.$x))
+.PHONY: $(foreach x,$(am.dist.formats),dist-$x)
+
+GZIP_ENV = --best
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
+       $(am.dist.post-remove-distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c 
>$(distdir).tar.bz2
+       $(am.dist.post-remove-distdir)
+
+dist-lzip: distdir
+       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} 
>$(distdir).tar.lz
+       $(am.dist.post-remove-distdir)
+
+dist-xz: distdir
+       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c 
>$(distdir).tar.xz
+       $(am.dist.post-remove-distdir)
+
+dist-zip: distdir
+       rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am.dist.post-remove-distdir)
+
+
+# -------------------------------------------------- #
+#  Building all the requested distribution flavors.  #
+# -------------------------------------------------- #
+
+ifdef
+AM_RECURSIVE_TARGETS += dist dist-all
+endif
+
+.PHONY: dist dist-all
+dist dist-all:
+       $(MAKE) $(DIST_TARGETS) am.dist.post-remove-distdir='@:'
+       $(am.dist.post-remove-distdir)
+
+
 # ---------------------------- #
 #  Checking the distribution.  #
 # ---------------------------- #
diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 9a4fd13..db4188d 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -289,84 +289,3 @@ if %?FILENAME_FILTER%
        else :; fi
 endif %?FILENAME_FILTER%
 endif %?TOPDIR_P%
-
-
-
-## --------------------------------------- ##
-## Building various distribution flavors.  ##
-## --------------------------------------- ##
-
-## Note that we don't use GNU tar's '-z' option.  One reason (but not
-## the only reason) is that some versions of tar (e.g., OSF1)
-## interpret '-z' differently.
-##
-## The -o option of GNU tar used to exclude empty directories.  This
-## behavior was fixed in tar 1.12 (released on 1997-04-25).  But older
-## versions of tar are still used (for instance NetBSD 1.6.1 ships
-## with tar 1.11.2).  We do not do anything specific w.r.t. this
-## incompatibility since packages where empty directories need to be
-## present in the archive are really unusual.
-##
-## We order DIST_TARGETS by expected duration of the compressors,
-## slowest first, for better parallelism in "make dist".  Do not
-## reorder DIST_ARCHIVES, users may expect gzip to be first.
-
-if %?TOPDIR_P%
-
-am.dist.ext.gzip  = tar.gz
-am.dist.ext.bzip2 = tar.bz2
-am.dist.ext.xz    = tar.xz
-am.dist.ext.lzip  = tar.lz
-am.dist.ext.zip   = zip
-
-DIST_TARGETS  = $(foreach x,$(am.dist.formats),dist-$x)
-DIST_ARCHIVES = $(foreach x,$(am.dist.formats),$(distdir).$(am.dist.ext.$x))
-# FIXME: hack to prevent the dumb Automake parser from mangling the list of
-# .PHONY targets.
-$(am.chars.empty).PHONY: $(foreach x,$(am.dist.formats),dist-$x)
-
-GZIP_ENV = --best
-dist-gzip: distdir
-       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c 
>$(distdir).tar.gz
-       $(am.dist.post-remove-distdir)
-
-dist-bzip2: distdir
-       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c 
>$(distdir).tar.bz2
-       $(am.dist.post-remove-distdir)
-
-dist-lzip: distdir
-       tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} 
>$(distdir).tar.lz
-       $(am.dist.post-remove-distdir)
-
-dist-xz: distdir
-       tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c 
>$(distdir).tar.xz
-       $(am.dist.post-remove-distdir)
-
-dist-zip: distdir
-       rm -f $(distdir).zip
-       zip -rq $(distdir).zip $(distdir)
-       $(am.dist.post-remove-distdir)
-
-endif %?TOPDIR_P%
-
-
-
-## ------------------------------------------------- ##
-## Building all the requested distribution flavors.  ##
-## ------------------------------------------------- ##
-
-## Currently we cannot use if/endif inside a rule.  The file_contents
-## parser needs work.
-
-if %?TOPDIR_P%
-
-.PHONY: dist dist-all
-if %?SUBDIRS%
-AM_RECURSIVE_TARGETS += dist dist-all
-endif %?SUBDIRS%
-
-dist dist-all:
-       $(MAKE) $(DIST_TARGETS) am.dist.post-remove-distdir='@:'
-       $(am.dist.post-remove-distdir)
-
-endif %?TOPDIR_P%
-- 
1.7.12.rc0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]