如何进行这样的目标匹配:
efl_class_bundles = \
efl_class_returnszero \
efl_class_cmd_regcmp \
efl_class_expression
.PHONY: $(efl_class_bundles)
$(efl_class_bundles): version syntax \
test/$@/efl_main.json \
test/$@/01_$@.json \
test/$@/02_efl_test_simple.json
prove t/efl_class_$@_csv.t
prove t/efl_class_$@_json.t
test/%/efl_main.json: test/%/efl_main.csv
$(CSVTOJSON) -b efl_main < $< > $@
perl -pi -e 's/csv/json/' $@
当我尝试制作efl_class_returnszero&#39;我收到以下错误,这表明前提条件test /$@/efl_main.json无法匹配目标&#39; test /%/ efl_main.json&#39;汉我可以做这个工作吗?
prove t/00_version.t
t/00_version.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.00 sys
Result: PASS
prove t/01_syntax.t
t/01_syntax.t .. ok
All tests successful.
Files=1, Tests=1, 0 wallclock secs ( 0.02 usr 0.00 sys
Result: PASS
make: *** No rule to make target 'test//efl_main.json', needed by
'efl_class_returnszero'. Stop.
答案 0 :(得分:1)
您不能在先决条件列表中使用$@
之类的自动变量。它们通常仅在配方中可用。请参阅手册中的automatic variables。
如果需要,您可以启用secondary expansion;你的规则将如下所示:
.SECONDEXPANSION:
(efl_class_bundles): version syntax \
test/$$@/efl_main.json \
test/$$@/01_$$@.json \
test/$$@/02_efl_test_simple.json
prove t/efl_class_$@_csv.t
prove t/efl_class_$@_json.t