]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] dist: memoize some internal variables
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 12 Jul 2012 13:58:25 +0000 (15:58 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 13 Jul 2012 08:33:32 +0000 (10:33 +0200)
* lib/am/distdir.am: Here, so that we will be able to use them several
times with no performance impact.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/distdir.am

index 52f0fa46caa8fe3e83d4305937794a2f6fd7f2af..371a57d3355f2a584cb5cfc2a9cace9a7128d0a9 100644 (file)
@@ -18,16 +18,17 @@ am__dist_common += %DIST-COMMON%
 
 ## Use 'sort', not 'am__uniq', for performance reasons.  Luckily, we
 ## don't care in which order the distributed files are.
-am__dist_files = $(strip $(sort \
-  $(am__dist_common) $(am__dist_sources) $(TEXINFOS) $(EXTRA_DIST)))
+am__dist_files = $(call am__memoize,am__dist_files,$(strip $(sort \
+  $(am__dist_common) $(am__dist_sources) $(TEXINFOS) $(EXTRA_DIST))))
 
 ## Try to avoid repeated slashed in the entries, to make the
 ## filtering in the 'am__dist_files_1' definition below more reliable.
 ## This idiom should compress up to four consecutive '/' characters in
 ## each $(am__dist_files) entry.
-am__dist_files_1 = $(subst //,/,$(subst //,/,$(am__dist_files)))
+am__dist_files_1 = $(call am__memoize,am__dist_files_1, \
+  $(subst //,/,$(subst //,/,$(am__dist_files))))
 
-am__dist_files_2 = \
+am__dist_files_2 = $(call am__memoize,am__dist_files_2, \
 ## Files filtered out here require an ad-hoc "munging"; see the two
 ## following 'patsubst's.
   $(filter-out $(srcdir)/% $(top_srcdir)/%, $(am__dist_files_1)) \
@@ -50,10 +51,11 @@ am__dist_files_2 = \
 ## prepended later by our VPATH-aware rules.
 ## The same caveats reported above apply.
   $(patsubst $(top_srcdir)/%, $(top_builddir)/%, \
-             $(filter $(top_srcdir)/%, $(am__dist_files_1)))
+             $(filter $(top_srcdir)/%, $(am__dist_files_1))))
 
 ## Strip extra whitespaces, for more safety.
-am__dist_files_cooked = $(strip $(am__dist_files_2))
+am__dist_files_cooked = \
+  $(call am__memoize,am__dist_files_cooked,$(strip $(am__dist_files_2)))
 
 ## Given the pre-processing done above to the list of distributed files,
 ## this definition ensures that we won't try to create the wrong
@@ -63,8 +65,9 @@ am__dist_files_cooked = $(strip $(am__dist_files_2))
 ## will allow our rules to correctly create "$(distdir)/subdir", and not
 ## "$(distdir)/$(srcdir)/subdir" -- which, in a VPATH build where
 ## "$(subdir) = ..", would be the build directory!
-am__dist_parent_dirs = $(strip $(sort \
-  $(filter-out ., $(patsubst ./%,%,$(dir $(am__dist_files_cooked))))))
+am__dist_parent_dirs = \
+  $(call am__memoize,am__dist_parent_dirs,$(strip $(sort \
+    $(filter-out ., $(patsubst ./%,%,$(dir $(am__dist_files_cooked)))))))
 
 if %?TOPDIR_P%
 distdir = $(PACKAGE)-$(VERSION)