## Use 'sort', not 'am.util.uniq', for performance reasons. Luckily, we
## don't care in which order the distributed files are.
-am.dist.all-files = $(call am__memoize,am.dist.all-files,$(strip $(sort \
+am.dist.all-files = $(call am.memoize,am.dist.all-files,$(strip $(sort \
$(am.dist.common-files) $(am.dist.sources) $(TEXINFOS) $(EXTRA_DIST))))
## Try to avoid repeated slashes in the entries, to make the filtering
## in the 'am.dist.files-tmp2' definition below more reliable.
## This idiom should compress up to four consecutive '/' characters
## in each $(am.dist.all-files) entry.
-am.dist.files-tmp1 = $(call am__memoize,am.dist.files-tmp1, \
+am.dist.files-tmp1 = $(call am.memoize,am.dist.files-tmp1, \
$(subst //,/,$(subst //,/,$(am.dist.all-files))))
-am.dist.files-tmp2 = $(call am__memoize,am.dist.files-tmp2, \
+am.dist.files-tmp2 = $(call am.memoize,am.dist.files-tmp2, \
## Files filtered out here require an ad-hoc "munging"; see the two
## following 'patsubst's.
$(filter-out $(srcdir)/% $(top_srcdir)/%, $(am.dist.files-tmp1)) \
## Strip extra whitespaces, for more safety.
am.dist.files-cooked = \
- $(call am__memoize,am.dist.files-cooked,$(strip $(am.dist.files-tmp2)))
+ $(call am.memoize,am.dist.files-cooked,$(strip $(am.dist.files-tmp2)))
## Given the pre-processing done above to the list of distributed files,
## this definition ensures that we won't try to create the wrong
## "$(distdir)/$(srcdir)/subdir" -- which, in a VPATH build where
## "$(subdir) = ..", would be the build directory!
am.dist.parent-dirs = \
- $(call am__memoize,am.dist.parent-dirs,$(strip $(sort \
+ $(call am.memoize,am.dist.parent-dirs,$(strip $(sort \
$(filter-out ., $(patsubst ./%,%,$(dir $(am.dist.files-cooked)))))))
am.mkdir-for-dist = \
## we can't afford to re-calculate it over and over every time the
## variable gets expanded. Example of usage:
##
-## var1 = $(am__memoize,var1,$(shell EXPENSIVE-COMMAND-LINE))
-## var2 = $(am__memoize,var2,$(sort VERY-LONG-LIST))
+## var1 = $(am.memoize,var1,$(shell EXPENSIVE-COMMAND-LINE))
+## var2 = $(am.memoize,var2,$(sort VERY-LONG-LIST))
##
## This API and implementation seems to work around a bug in GNU make
## (present up to and including version 3.82) which caused our first
##
## So please don't change this without a very good reason.
##
-am__memoize = $(or $(am__memoized_value/$1),$(strip \
+am.memoize = $(or $(am__memoized_value/$1),$(strip \
$(eval am__memoized_value/$1 := $$2))$(am__memoized_value/$1))
## $(call am.util.strip-suffixes, SUFFIXES, LIST)
# This supports runtime overriding of $(TESTS) and $(XFAIL_TESTS).
!am__test_bases ?= \
-! $(call am__memoize,am__test_bases,$(call am__get_test_bases,$(TESTS)))
+! $(call am.memoize,am__test_bases,$(call am__get_test_bases,$(TESTS)))
am__xfail_test_bases = \
- $(call am__memoize,am__xfail_test_bases,$(call am__get_test_bases,$(XFAIL_TESTS)))
+ $(call am.memoize,am__xfail_test_bases,$(call am__get_test_bases,$(XFAIL_TESTS)))
# The $(strip) is to work around the GNU make 3.80 bug where trailing
# whitespace in "TESTS = foo.test $(empty)" causes $(TESTS_LOGS) to
# erroneously expand to "foo.log .log".
am__test_results = \
- $(call am__memoize,am__test_results,$(addsuffix .trs,$(strip $(am__test_bases))))
+ $(call am.memoize,am__test_results,$(addsuffix .trs,$(strip $(am__test_bases))))
am__test_logs = \
- $(call am__memoize,am__test_logs,$(addsuffix .log,$(strip $(am__test_bases))))
+ $(call am.memoize,am__test_logs,$(addsuffix .log,$(strip $(am__test_bases))))
am__mostlyclean_files += $(am__test_results) $(am__test_logs)
T "basic usage" <<'END'
-foo = $(call am__memoize,foo,ok)
+foo = $(call am.memoize,foo,ok)
test:
test '$(foo)' = ok
T "variables expanding to blanks only (1)" <<'END'
-foo = $(call am__memoize,foo,$(am.chars.empty) )
+foo = $(call am.memoize,foo,$(am.chars.empty) )
test:
test '$(foo)' = ' '
T "variables expanding to blanks only (2)" <<END
blank = \$(am.chars.empty) $tab$tab \$(am.chars.empty)
-foo = \$(call am__memoize,foo,\$(blank))
+foo = \$(call am.memoize,foo,\$(blank))
test:
test '\$(foo)' = ' $tab$tab '
T "very long variable name" <<END
-$var = \$(call am__memoize,$var,foo)
+$var = \$(call am.memoize,$var,foo)
test:
# Why we silence this?
T "very long variable name with long content" <<END
-$var = \$(call am__memoize,$var,$val)
+$var = \$(call am.memoize,$var,$val)
test:
# Why we silence this?
T "memoize indirect recursive variable expansion" <<'END'
-foo = $(call am__memoize,foo,$(indir))
+foo = $(call am.memoize,foo,$(indir))
## This is delibrately placed after the memoize call.
indir = zardoz
T "memoize indirect immediate variable expansion" <<'END'
-foo = $(call am__memoize,foo,$(indir))
+foo = $(call am.memoize,foo,$(indir))
## This is delibrately placed after the memoize call.
indir := blob
T "memoize function call (containing builtin calls)" <<'END'
my_func = $(firstword $(sort $(1)))
-foo = $(call am__memoize,foo,$(call my_func, 6 3 1 7))
+foo = $(call am.memoize,foo,$(call my_func, 6 3 1 7))
test:
test '$(foo)' = 1
T "expanded as function argument" <<'END'
-foo = $(call am__memoize,foo,bar)
+foo = $(call am.memoize,foo,bar)
func = ::$(0)::$(1)::
test:
T "expanded as function argument (trickier)" <<'END'
-foo = $(call am__memoize,foo,zardoz)
+foo = $(call am.memoize,foo,zardoz)
indir_func = ::$($1)::
test:
T "expanded into another memoized variable" <<'END'
-foo = $(call am__memoize,foo,one $(bar))
-bar = $(call am__memoize,bar,two $(baz))
-baz = $(call am__memoize,baz,$(sort 4 3))
+foo = $(call am.memoize,foo,one $(bar))
+bar = $(call am.memoize,bar,two $(baz))
+baz = $(call am.memoize,baz,$(sort 4 3))
test:
test '$(foo)' = 'one two 3 4'
T "memoization actually takes place (1)" <<'END'
indir := ok
-foo = $(call am__memoize,foo,$(indir))
+foo = $(call am.memoize,foo,$(indir))
expand-it := $(foo)
override indir := ko
indir := ok
expand = $(eval expanded-to := $$($1))
-foo = $(call am__memoize,foo,$(indir))
+foo = $(call am.memoize,foo,$(indir))
$(call expand,foo)
override indir := ko
T "memoization actually takes place (3)" <<'END'
-foo1 = $(call am__memoize,foo1,$(shell test -f x && echo "+"))
-foo2 = $(call am__memoize,foo2,$(shell test -f y || echo "-"))
+foo1 = $(call am.memoize,foo1,$(shell test -f x && echo "+"))
+foo2 = $(call am.memoize,foo2,$(shell test -f y || echo "-"))
test: one two
two: one
T "definition on multiple lines" <<'END'
-foo = $(call am__memoize,foo,a \
+foo = $(call am.memoize,foo,a \
b \
c \
\
setup := $(shell mkdir -p t/pm && : > t/pm/Cond2.pl)
TESTS = $(wildcard t/pm/Cond2.pl)
-am__test_bases = $(call am__memoize,am__test_bases,$(TESTS))
+am__test_bases = $(call am.memoize,am__test_bases,$(TESTS))
test:
test '$(am__test_bases)' = 't/pm/Cond2.pl'
mv -f t1 t
done
-echo "list = \$(call am__memoize,list,$line \\" >> big.mk
+echo "list = \$(call am.memoize,list,$line \\" >> big.mk
cat t >> big.mk
echo " $line)" >> big.mk