Makefile generic pattern rule — xyzzy-en_US.ext2 from xyzzy.ext0

邮差的信 提交于 2019-12-03 21:04:27

There is no good way to do this with Make (regex handling is high on my wishlist) but here is a kludge.

You can have a separate rule for each locale which will work with any "thing" (xyzzy, or whatever). But since you don't know beforehand what locale will be called for, but you do know what ext0 files exist, it might be better to make a rule for every "thing":

THINGS = $(basename $(wildcard *.ext0)) # xyzzy qrssr...

define TEMPLATE
$(1)-%.ext2: $(1).ext1
    @echo produce $$@ from $$^ using $$*
endef

$(foreach thing,$(THINGS),$(eval $(call TEMPLATE,$(thing))))
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!