automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 1/3] [ng] dist: memoize some internal variables


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 1/3] [ng] dist: memoize some internal variables
Date: Fri, 13 Jul 2012 12:19:19 +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 <address@hidden>
---
 lib/am/distdir.am |   19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/lib/am/distdir.am b/lib/am/distdir.am
index 52f0fa4..371a57d 100644
--- a/lib/am/distdir.am
+++ b/lib/am/distdir.am
@@ -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)
-- 
1.7.9.5




reply via email to

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