$(call VAR, 参数1, 参数2,...)
reverse = $(2)$(1)
foo = $(call reverse, a, b)
all:
@echo "foo = $(foo)"
$ make
foo = b a
lsfirstpath = $(subst /ls, ,$(wildcard $(addsuffix /$(1),$(subst :, ,$(PATH)))))
lsPath := $(call lsfirstpath,ls)
all:
@echo "command 'ls' is in \"$(call lsfirstpath,ls)\""
[beyes@beyes exp2]$ make
command 'ls' is in "/bin "
k = $(2)$(1)
map = $(foreach a,$(2),$(call $(1),$(a),good-))
o = $(call map,k,are you ok)
all:
@echo "$(o)"
[beyes@beyes exp3]$ make
good-are good-you good-ok
$(foreach a,are you ok,$(call k,$(a),good-))
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |