?? secondary
字號:
#! -*-perl-*-$description = "Test the behaviour of the .SECONDARY target.";$details = "\Test the behavior of the .SECONDARY special target.Create a makefile where a file would not normally be consideredintermediate, then specify it as .SECONDARY. Build and note that it'snot automatically deleted. Delete the file. Rebuild to ensure thatit's not created if it doesn't exist but doesn't need to be built.Change the original and ensure that the secondary file and the ultimatetarget are both rebuilt, and that the secondary file is not deleted.Try this with implicit rules and explicit rules: both should work.\n";open(MAKEFILE,"> $makefile");print MAKEFILE <<'EOF';.SECONDARY: foo.e# Implicit rule test%.d : %.e ; cp $< $@%.e : %.f ; cp $< $@foo.d: foo.e# Explicit rule testfoo.c: foo.e ; cp $< $@EOFclose(MAKEFILE);# TEST #1&utouch(-20, 'foo.f');&run_make_with_options($makefile,'foo.d',&get_logfile);$answer = "cp foo.f foo.e\ncp foo.e foo.d\n";&compare_output($answer, &get_logfile(1));# TEST #2unlink('foo.e');&run_make_with_options($makefile,'foo.d',&get_logfile);$answer = "$make_name: `foo.d' is up to date.\n";&compare_output($answer, &get_logfile(1));# TEST #3&utouch(-10, 'foo.d');&touch('foo.f');&run_make_with_options($makefile,'foo.d',&get_logfile);$answer = "cp foo.f foo.e\ncp foo.e foo.d\n";&compare_output($answer, &get_logfile(1));# TEST #4&run_make_with_options($makefile,'foo.c',&get_logfile);$answer = "cp foo.e foo.c\n";&compare_output($answer, &get_logfile(1));# TEST #5unlink('foo.e');&run_make_with_options($makefile,'foo.c',&get_logfile);$answer = "$make_name: `foo.c' is up to date.\n";&compare_output($answer, &get_logfile(1));# TEST #6&utouch(-10, 'foo.c');&touch('foo.f');&run_make_with_options($makefile,'foo.c',&get_logfile);$answer = "cp foo.f foo.e\ncp foo.e foo.c\n";&compare_output($answer, &get_logfile(1));unlink('foo.f', 'foo.e', 'foo.d', 'foo.c');# This tells the test driver that the perl test script executed properly.1;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -