2 The following test creates a makefile to test the presence
3 of multiple rules for one target. One file can be the
4 target of several rules if at most one rule has commands;
5 the other rules can only have dependencies.";
8 The makefile created in this test contains two hardcoded rules
9 for foo.o and bar.o. It then gives another multiple target rule
10 with the same names as above but adding more dependencies.
11 Additionally, another variable extradeps is listed as a
12 dependency but is defined to be null. It can however be defined
13 on the make command line as extradeps=extra.h which adds yet
14 another dependency to the targets.";
16 open(MAKEFILE,"> $makefile");
18 # The Contents of the MAKEFILE ...
25 \$(objects) : config.h \$(extradeps)
29 # END of Contents of MAKEFILE
33 &touch("defs.h","test.h","config.h");
44 &run_make_with_options($makefile,
49 # Create the answer to what should be produced by this Makefile
50 $answer = "$make_name: *** No rule to make target `extra.h', needed by `foo.o'. Stop.\n";
52 &compare_output($answer,&get_logfile(1));
60 &run_make_with_options($makefile,
65 # Create the answer to what should be produced by this Makefile
66 $answer = "EXTRA EXTRA\n";
68 &compare_output($answer,&get_logfile(1));
70 unlink("defs.h","test.h","config.h","extra.h");