📄 reinvoke
字号:
# -*-mode: perl-*-$description = "Test GNU make's auto-reinvocation feature.";$details = "\If the makefile or one it includes can be rebuilt then it is, and makeis reinvoked. We create a rule to rebuild the makefile from a tempfile, then touch the temp file to make it newer than the makefile.";$makefile2 = &get_tmpfile;$makefile_orig = &get_tmpfile;open(MAKEFILE,"> $makefile");print MAKEFILE <<EOM;all: ; \@echo 'running rules.'$makefile $makefile2: $makefile_orig \@echo 'rebuilding \$\@.' \@echo >> \$\@include $makefile2EOMclose(MAKEFILE);&utouch(-10, $makefile, $makefile2);&touch($makefile_orig);&run_make_with_options($makefile, "", &get_logfile, 0);# Create the answer to what should be produced by this Makefile$answer = "rebuilding $makefile2.\nrebuilding $makefile.\nrunning rules.\n";&compare_output($answer,&get_logfile(1)) && unlink "$makefile_orig";# In this test we create an included file that's out-of-date, but then# the rule doesn't update it. Make shouldn't re-exec.$makefile3 = &get_tmpfile;open(MAKEFILE, "> $makefile3");print MAKEFILE <<'EOM';SHELL = /bin/shall: ; @echo helloa : b ; echo >> $@b : c ; [ -f $@ ] || echo >> $@c: ; echo >> $@include $(F)EOMclose(MAKEFILE);&utouch(-20, 'b','a');#&utouch(-10, 'a');&touch('c');# First try with the file that's not updated "once removed" from the# file we're including.&run_make_with_options($makefile3, "F=a", &get_logfile, 0);$answer = "[ -f b ] || echo >> b\nhello\n";&compare_output($answer,&get_logfile(1));# Now try with the file we're not updating being the actual file we're# including: this and the previous one test different parts of the code.&run_make_with_options($makefile3, "F=b", &get_logfile, 0);$answer = "[ -f b ] || echo >> b\nhello\n";&compare_output($answer,&get_logfile(1));unlink('a','b','c');# This tells the test driver that the perl test script executed properly.1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -