Makefile, Regex and multiple dependencies

﹥>﹥吖頭↗ 提交于 2019-12-05 21:56:39

Functions are applied before pattern matching rules, so you cannot use % in a glob.

There is probably a better solution, but I came up with:

.dep-%.pdf: %.tex
    @bash -c 'shopt -s nullglob; for x in $*.*.dot; do \
      echo "$*.pdf: $$x.tex"; \
    done' > $@
PDFS := $(patsubst %.tex,%.pdf,$(wildcard [0-9][0-9].tex))
include $(patsubst %,.dep-%,$(PDFS))
%.pdf: %.tex | .dep-%.pdf

As long as you don't add or create X.*.dot files without also modifying X.tex files, this should work.

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