mult_rules

来自「make debug tool. You can use this tool t」· 代码 · 共 84 行

TXT
84
字号
#                                                                    -*-perl-*-#$Id: mult_rules,v 1.2 2005/12/18 02:05:45 rockyb Exp $$description = "\The following test creates a makefile to test the presenceof multiple rules for one target.  One file can be thetarget of several rules if at most one rule has commands;the other rules can only have dependencies.";$details = "\The makefile created in this test contains two hardcoded rulesfor foo.o and bar.o.  It then gives another multiple target rulewith the same names as above but adding more dependencies.Additionally, another variable extradeps is listed as adependency but is defined to be null.  It can however be definedon the make command line as extradeps=extra.h which adds yetanother dependency to the targets.";open(MAKEFILE,"> $makefile");# The Contents of the MAKEFILE ...print MAKEFILE <<EOF;objects = foo.o bar.ofoo.o : defs.hbar.o : defs.h test.hextradeps = \$(objects) : config.h \$(extradeps) \t\@echo EXTRA EXTRAEOF# END of Contents of MAKEFILEclose(MAKEFILE);&touch("defs.h","test.h","config.h");if ($vos){   $error_code = 3307;}else {   $error_code = 512;}&run_make_with_options($makefile,                       "extradeps=extra.h",                       &get_logfile,                       $error_code);# Create the answer to what should be produced by this Makefile$answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'.  Stop.Command-line arguments:	\"-f work/features/mult_rules.mk extradeps=extra.h\"";&compare_output($answer,&get_logfile(1));# TEST #2# -------&touch("extra.h");&run_make_with_options($makefile,                       "extradeps=extra.h",                       &get_logfile,                       0);# Create the answer to what should be produced by this Makefile$answer = "EXTRA EXTRA\n";&compare_output($answer,&get_logfile(1));unlink("defs.h","test.h","config.h","extra.h");1;

⌨️ 快捷键说明

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