VirtualBox

source: kBuild/vendor/gnumake/current/tests/scripts/functions/if

最後變更 在這個檔案是 2596,由 bird 提交於 13 年 前

gnumake/current -> 3.82-cvs.

  • 屬性 svn:eol-style 設為 LF
檔案大小: 935 位元組
 
1# -*-perl-*-
2$description = "Test the if function.\n";
3
4$details = "Try various uses of if and ensure they all give the correct
5results.\n";
6
7open(MAKEFILE, "> $makefile");
8
9print MAKEFILE <<EOMAKE;
10NEQ = \$(subst \$1,,\$2)
11e =
12
13all:
14\t\@echo 1 \$(if ,true,false)
15\t\@echo 2 \$(if ,true,)
16\t\@echo 3 \$(if ,true)
17\t\@echo 4 \$(if z,true,false)
18\t\@echo 5 \$(if z,true,\$(shell echo hi))
19\t\@echo 6 \$(if ,\$(shell echo hi),false)
20\t\@echo 7 \$(if \$(call NEQ,a,b),true,false)
21\t\@echo 8 \$(if \$(call NEQ,a,a),true,false)
22\t\@echo 9 \$(if z,true,fal,se) hi
23\t\@echo 10 \$(if ,true,fal,se)there
24\t\@echo 11 \$(if \$(e) ,true,false)
25EOMAKE
26
27close(MAKEFILE);
28
29&run_make_with_options($makefile, "", &get_logfile);
30$answer = "1 false\n2\n3\n4 true\n5 true\n6 false\n7 true\n8 false\n9 true hi\n10 fal,sethere\n11 false\n";
31&compare_output($answer, &get_logfile(1));
32
331;
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette