【发布时间】:2013-04-03 15:36:40
【问题描述】:
我正在尝试创建一个 Makefile,它将通过 tic 编译驻留在目录中的 terminfo 文件。 tic 还将它自动创建的 termcap 文件复制到系统或用户特定的目标文件夹。对于普通用户,如果 terminfo 文件是例如screen-256color-bce-s.terminfo,会编译复制到~/.terminfo/s/screen-256color-bce-s。所以它看起来像这样:
terminfo/screen-256color-bce-s.terminfo => /home/user/.terminfo/s/screen-256color-bce-s
terminfo/screen-256color-s.terminfo => /home/user/.terminfo/s/screen-256color-s
如果我将这样的内容放入我的 Makefile 中:
TISRC = $(wildcard terminfo/*.terminfo)
TIDST = $(foreach x, $(TISRC), $(HOME)/.terminfo/$(shell basename $x|cut -c 1)/$(shell basename $x .terminfo))
$(HOME)/.terminfo/s/%: terminfo/%.terminfo
@echo "$< => $@"
@tic $<
install: $(TIDST)
它有效。但是,我想使其通用,并在目标中使用通配符,即:
$(HOME)/.terminfo/**/%: terminfo/%.terminfo
@echo "$< => $@"
@tic $<
能够将 terminfo 文件添加到我的本地存储库。但是,上述方法不起作用。如何在模式规则中指定通配符目录?
【问题讨论】:
-
我不认为你可以; Make 不太适合使用通配符。