patspecific_vars

来自「make的源代码」· 代码 · 共 50 行

TXT
50
字号
#                                                                    -*-perl-*-$description = "Test pattern-specific variable settings.";$details = "\Create a makefile containing various flavors of pattern-specific variablesettings, override and non-override, and using various variable expansionrules, semicolon interference, etc.";open(MAKEFILE,"> $makefile");print MAKEFILE <<'EOF';all: one.x two.x three.xFOO = fooBAR = barBAZ = bazthr% : override BAZ = threet%.x: BAR = four%.x: BAR = two%.x: override BAZ = threeone.x: override FOO = oneone.x two.x three.x: ; @echo $(FOO) $(BAR) $(BAZ)four.x: baz ; @echo $(FOO) $(BAR) $(BAZ)baz: ; @echo $(FOO) $(BAR) $(BAZ)EOFclose(MAKEFILE);# TEST #1 -- basics&run_make_with_options($makefile, "", &get_logfile);$answer = "one two three\nfoo four baz\nfoo bar three\n";&compare_output($answer,&get_logfile(1));# TEST #2 -- try the override feature&run_make_with_options($makefile, "BAZ=five", &get_logfile);$answer = "one two three\nfoo four five\nfoo bar three\n";&compare_output($answer,&get_logfile(1));# TEST #3 -- make sure patterns are inherited properly&run_make_with_options($makefile, "four.x", &get_logfile);$answer = "foo two three\nfoo two three\n";&compare_output($answer,&get_logfile(1));1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?