【发布时间】:2020-07-22 06:03:15
【问题描述】:
像这样的Makefile
list-%: $(wildcard src/modules/%/*.ts)
echo '?' $? - '@' $@ - '%' $% - '<' $< - '^' $^ - '+' $+ - '|' $| - '*' $*
但依赖项无法按预期工作。 make list-test 的输出是
echo '?' - '@' list-test - '%' - '<' - '^' - '+' - '|' - '*' test
? - @ list-test - % - < - ^ - + - | - * test
如果改为$(wildcard src/modules/test/*.ts),则输出变为
echo '?' src/modules/test/index.ts - '@' list-test - '%' - '<' src/modules/test/index.ts - '^' src/modules/test/index.ts - '+' src/modules/test/index.ts - '|' - '*' test
? src/modules/test/index.ts - @ list-test - % - < src/modules/test/index.ts - ^ src/modules/test/index.ts - + src/modules/test/index.ts - | - * test
我怎样才能使$(wildcard src/modules/%/*.ts) 工作?
【问题讨论】: