From 5442fb372227b460a6927efe6180a777b530dcf8 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Thu, 12 Jul 2012 15:58:25 +0200 Subject: [PATCH] [ng] dist: memoize some internal variables * 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 --- 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 52f0fa46c..371a57d33 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) -- 2.47.2