📄 origin
字号:
# -*-perl-*-$description = "Test the origin function.";$details = "This is a test of the origin function in gnu make.This function will report on where a variable wasdefined per the following list:'undefined' never defined'default' default definition'environment' environment var without -e'environment override' environment var with -e'file' defined in makefile'command line' defined on the command line'override' defined by override in makefile'automatic' Automatic variable\n";# On WIN32 systems, HOME is meaningless. SystemRoot should be defined# though. With DJGPP, HOME is not guaranteed to be defined. Use DJDIR# instead.#$homevar = (($port_type eq 'Windows') ? "SystemRoot" : (($port_type eq 'DOS') ? "DJDIR" : "HOME"));open(MAKEFILE,"> $makefile");print MAKEFILE <<EOF;foo := bletch garfauto_var = udef CC $homevar MAKE foo CFLAGS WHITE \@av = \$(foreach var, \$(auto_var), \$(origin \$(var)) )override WHITE := BLACKall: auto\t\@echo \$(origin undefined)\t\@echo \$(origin CC)\t\@echo \$(origin $homevar)\t\@echo \$(origin MAKE)\t\@echo \$(origin foo)\t\@echo \$(origin CFLAGS)\t\@echo \$(origin WHITE)\t\@echo \$(origin \@)auto :\t\@echo \$(av)EOFclose(MAKEFILE);&run_make_with_options($makefile, "-e WHITE=WHITE CFLAGS=", &get_logfile);# Create the answer to what should be produced by this Makefile$answer = "undefined default environment default file command line override automaticundefineddefaultenvironmentdefaultfilecommand lineoverrideautomatic\n";&compare_output($answer,&get_logfile(1));1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -