am.chars.empty :=
am.util.strip-first-word = $(wordlist 2,$(words $(1)),$(1))
-am__strip_lastword = $(wordlist 2,$(words $(1)),dummy $(1))
+am.util.strip-last-word = $(wordlist 2,$(words $(1)),dummy $(1))
## Remove repeated elements from the given list (without reordering),
## and return the reduced list.
## Call the function recursively on the list of all the elements
## but the last one.
$(call am__uniq, \
- $(call am__strip_lastword, $(1))) \
+ $(call am.util.strip-last-word, $(1))) \
## And append the last element, unless it was already present.
$(if $(filter $(lastword $(1)), \
- $(call am__strip_lastword, $(1))), \
+ $(call am.util.strip-last-word, $(1))), \
$(am.chars.empty), \
$(lastword $(1)))))
test '$(call am.util.strip-first-word,1 2 3 4 5 6 7 8)' = '2 3 4 5 6 7 8'
test '$(call am.util.strip-first-word, 1 2 )' = '2'
-.PHONY: test-strip-lastword
-test-strip-lastword:
- test '$(call am__strip_lastword,)' = ''
- test '$(call am__strip_lastword,1)' = ''
- test '$(call am__strip_lastword,1 1)' = '1'
- test '$(call am__strip_lastword,1 2)' = '1'
- test '$(call am__strip_lastword,1 2 3 4 5 6 7 8)' = '1 2 3 4 5 6 7'
- test '$(call am__strip_lastword, 1 2 )' = '1'
+.PHONY: test-strip-last-word
+test-strip-last-word:
+ test '$(call am.util.strip-last-word,)' = ''
+ test '$(call am.util.strip-last-word,1)' = ''
+ test '$(call am.util.strip-last-word,1 1)' = '1'
+ test '$(call am.util.strip-last-word,1 2)' = '1'
+ test '$(call am.util.strip-last-word,1 2 3 4 5 6 7 8)' = '1 2 3 4 5 6 7'
+ test '$(call am.util.strip-last-word, 1 2 )' = '1'
.PHONY: test-uniq
test-uniq:
END
command_ok_ am.util.strip-first-word $MAKE test-strip-first-word
-command_ok_ am__strip_lastword $MAKE test-strip-lastword
+command_ok_ am.util.strip-last-word $MAKE test-strip-last-word
command_ok_ am__uniq $MAKE test-uniq
command_ok_ am__test_strip_suffixes $MAKE test-strip-suffixes
command_ok_ am__tolower $MAKE test-tolower