Convert all "`'" quotes to "''" per new GNU Coding Standard guidelines.
[make.git] / tests / scripts / features / mult_rules
blobe706e17d102117a0692cc34be9ad0c860ecd4e4c
1 $description = "\
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.";
7 $details = "\
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 ...
20 print MAKEFILE <<EOF;
21 objects = foo.o bar.o
22 foo.o : defs.h
23 bar.o : defs.h test.h
24 extradeps = 
25 \$(objects) : config.h \$(extradeps) 
26 \t\@echo EXTRA EXTRA
27 EOF
29 # END of Contents of MAKEFILE
31 close(MAKEFILE);
33 &touch("defs.h","test.h","config.h");
35 if ($vos)
37    $error_code = 3307;
39 else 
41    $error_code = 512;
44 &run_make_with_options($makefile,
45                        "extradeps=extra.h",
46                        &get_logfile,
47                        $error_code);
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));
55 # TEST #2
56 # -------
58 &touch("extra.h");
60 &run_make_with_options($makefile,
61                        "extradeps=extra.h",
62                        &get_logfile,
63                        0);
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");