- 论坛徽章:
- 0
|
30可用积分
本帖最后由 Perlvim 于 2012-03-07 10:01 编辑
用make的大都是搞C语言的,但我现在确实在用Perl 重写Make ,所以想在这里问这个问题。我相信没有最厉害的,只有更厉害的高手在这里。
一个没有相应的更新命令的目标,如果文件不存在,就要查找隐含更新规则。
一个有相应的更新命令的目标, 如果文件不存在,就不查找隐含更新规则。
是这样吗?我感觉这个可能的现实很难接受。
因为 Make 怎么知道更新目标的命令是有效的呢?
以下两段代码将产生截然不同的解析结果
1.-------------------------------------
.PHONY : all test
.SUFFIXES : .pbc .pmc
.pmc.pbc :
@echo hello .pbc.pmc
all : not_exists_file1.pbc not_exists_file2.pbc
@echo hello all
not_exists_file1.pbc :
@echo hello not_exists_file1.pbc
not_exists_file2.pbc :
@echo hello not_exists_file2.pbc
test :
touch not_exists_file1.pmc
touch not_exists_file2.pmc
------------------------------------------
2.-----------------------------------
.PHONY : all test
.SUFFIXES : .pbc .pmc
.pmc.pbc :
@echo hello .pbc.pmc
all : not_exists_file1.pbc not_exists_file2.pbc
@echo hello all
not_exists_file1.pbc :
@echo hello not_exists_file1.pbc
not_exists_file2.pbc :
# @echo hello not_exists_file2.pbc
test :
touch not_exists_file1.pmc
touch not_exists_file2.pmc
-----------------------------------------
是这样吗? |
|