]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] dist: more verbatim inclusion of relevant makefile fragments
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 09:37:27 +0000 (11:37 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 09:37:48 +0000 (11:37 +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 <stefano.lattarini@gmail.com>
lib/am/distcheck.mk
lib/am/distdir.am

index 3504dc0f0f6c8eeeb00ac9d0922027c6b229cdd6..227403993d4b6b7c1ed0112a4931a0b7b9eb8986 100644 (file)
 ## 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.  #
 # ---------------------------- #
index 9a4fd138f1835f6431f5e4b68bed9b4b4910ac31..db4188df3dce60e5a1f548f9ebfd1cd3bd86388d 100644 (file)
@@ -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%