使用通配符目标时 Makefile 目标自动完成
Makefile targets autocomplete when using wild card targets
> ls
abcd.config efgh.config ijkl.config
生成文件:
%_defconfig: %.config
@echo "Some commands i want to run on %.config"
我想要的是
的自我暗示(制表完成)
abcd_defconfig
efgh_defconfig
ijkl_defconfig
明确声明要自动完成的目标?例如使用 wildcard
和 patsubst
函数和静态模式规则而不是模式规则:
configs := $(wildcard *.config)
defconfigs := $(patsubst %.config,%_defconfig,$(configs))
$(defconfigs): %_defconfig: %.config
@echo "Some commands i want to run on $<"
> ls
abcd.config efgh.config ijkl.config
生成文件:
%_defconfig: %.config
@echo "Some commands i want to run on %.config"
我想要的是
的自我暗示(制表完成)abcd_defconfig
efgh_defconfig
ijkl_defconfig
明确声明要自动完成的目标?例如使用 wildcard
和 patsubst
函数和静态模式规则而不是模式规则:
configs := $(wildcard *.config)
defconfigs := $(patsubst %.config,%_defconfig,$(configs))
$(defconfigs): %_defconfig: %.config
@echo "Some commands i want to run on $<"