]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] distdir: verbatim inclusion of relevant makefile fragment
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 12:42:23 +0000 (14:42 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 11 Aug 2012 13:39:01 +0000 (15:39 +0200)
* lib/am/distdir.am: Rename ...
* lib/am/distdir.mk: ... like here, with related adjustments.
* automake.in (handle_dist): Include it using the 'verbatim'
function, rather than the 'file_contents' one.
* Makefile.am (dist_am_DATA): Adjust.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Makefile.am
automake.in
lib/am/distdir.mk [moved from lib/am/distdir.am with 98% similarity]

index 24b75d0a0b80749b30f030922371a420032ada73..6a773a9f42a607879b6be8b6793f51772b253e7d 100644 (file)
@@ -196,11 +196,11 @@ dist_am_DATA = \
   lib/am/tags.mk \
   lib/am/dejagnu.mk \
   lib/am/distcheck.mk \
+  lib/am/distdir.mk \
   lib/am/compile.am \
   lib/am/configure.am \
   lib/am/data.am \
   lib/am/depend2.am \
-  lib/am/distdir.am \
   lib/am/footer.am \
   lib/am/header.am \
   lib/am/java.am \
index f35e4e1bf91d36d413b58129255f34bee78454f3..a6a26d570c1f88cf0fcabf4cefaac58ecd4726ab 100644 (file)
@@ -3301,7 +3301,7 @@ sub handle_dist ()
   define_variable ('am.dist.extra-targets', INTERNAL, @dist_targets);
   define_variable ('am.dist.common-files.internal', INTERNAL, @dist_common);
 
-  $output_rules .= &file_contents ('distdir', new Automake::Location);
+  verbatim ('distdir');
   verbatim ('distcheck') if $relative_dir eq '.';
 }
 
similarity index 98%
rename from lib/am/distdir.am
rename to lib/am/distdir.mk
index 3a3be46d2db9ccf7a091a02eff6d4b195bede36c..53b3c4f8890a76731efd29a669ee56a4581ac205 100644 (file)
@@ -84,10 +84,13 @@ am.dist.write-filelist = \
   @lst='$1'; for x in $$lst; do echo $$x; done \
     >> $(am.dir)/$@-list$(am.chars.newline)
 
-if %?TOPDIR_P%
+ifdef am.conf.is-topdir
 
 # This is user-overridable.
+ifeq ($(call am.vars.is-undef,distdir),yes)
 distdir = $(PACKAGE)-$(VERSION)
+endif
+
 # This is not, but must be public to be avaialable in the "dist-hook"
 # rules (this is also documented in the Automake manual).
 top_distdir = $(distdir)
@@ -112,9 +115,9 @@ am.dist.remove-distdir = \
 # creation of different tarball formats.
 am.dist.post-remove-distdir = $(am.dist.remove-distdir)
 
-endif %?TOPDIR_P%
+endif # am.conf.is-topdir
 
-if %?SUBDIRS%
+ifdef SUBDIRS
 # Computes a relative pathname RELDIR such that DIR1/RELDIR = DIR2.
 # Input:
 #   - dir1      relative pathname, relative to the current directory.
@@ -146,29 +149,27 @@ am.dist.relativize-path = \
     dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
   done; \
   reldir="$$dir2"
-endif %?SUBDIRS%
+endif # SUBDIRS
 
 .PHONY: distdir
-if %?SUBDIRS%
+ifdef SUBDIR
 AM_RECURSIVE_TARGETS += distdir
-endif %?SUBDIRS%
+endif
 
 distdir: $(am.dist.all-files) | $(am.dir)
 ##
 ## For Gnits users, this is pretty handy.  Look at 15 lines
 ## in case some explanatory text is desirable.
 ##
-if %?TOPDIR_P%
+ifdef am.conf.is-topdir
        @$(if $(am.conf.check-news), \
        sed 15q $(srcdir)/NEWS | grep -F '$(VERSION)' || { \
          echo "NEWS not updated; not releasing" 1>&2; \
          exit 1; \
        })
-endif %?TOPDIR_P%
-if %?TOPDIR_P%
        $(am.dist.remove-distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
-endif %?TOPDIR_P%
+endif
 ## Make the subdirectories for the files, avoiding to exceed command
 ## line length limitations.
        $(call am.xargs-map,am.dist.xmkdir,$(am.dist.parent-dirs))
@@ -223,7 +224,7 @@ endif %?TOPDIR_P%
 ## at the top level do the right thing.  If we're in the topmost
 ## directory, then we use 'distdir' instead of 'top_distdir'; this lets
 ## us work correctly with an enclosing package.
-if %?SUBDIRS%
+ifdef SUBDIRS
        @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
          if test "$$subdir" = .; then :; else \
            $(am.make.dry-run) \
@@ -251,7 +252,7 @@ if %?SUBDIRS%
              || exit 1; \
          fi; \
        done
-endif %?SUBDIRS%
+endif # SUBDIRS
 ##
 ## We might have to perform some last second updates, such as updating
 ## info files.
@@ -279,7 +280,7 @@ endif %?SUBDIRS%
 ## the whole subtree again.  This is a complexity reduction for a deep
 ## hierarchy of subpackages.
 ##
-if %?TOPDIR_P%
+ifdef am.conf.is-topdir
        -test -n "$(am.dist.skip-mode-fix)" \
        || find "$(distdir)" -type d ! -perm -755 \
                -exec chmod u+rwx,go+rx {} \; -o \
@@ -293,4 +294,4 @@ if %?TOPDIR_P%
          echo '$@: error: the above filenames are too long' 1>&2; \
          exit 1; \
        else :; fi)
-endif %?TOPDIR_P%
+endif