- Enhance .POSIX to set -e when invoking shells, as demanded by a
[make.git] / tests / scripts / features / mult_targets
blobc8ff4189b70f7cc3c226197ed6e24bdfc133f2e8
1 $description = "The following test creates a makefile to test that a \n "
2               ."rule with multiple targets is equivalent to writing \n"
3               ."many rules, each with one target, and all identical aside\n"
4               ."from that.";
6 $details = "A makefile is created with one rule and two targets.  Make \n"
7           ."is called twice, once for each target, and the output which \n"
8           ."contains the target name with \$@ is looked at for the changes.\n"
9           ."This test also tests the substitute function by replacing \n"
10           ."the word output with nothing in the target name giving either\n"
11           ."an output of \"I am little\" or \"I am big\"";  
13 open(MAKEFILE,"> $makefile");
15 # The Contents of the MAKEFILE ...
17 print MAKEFILE "bigoutput littleoutput: test.h\n";
18 print MAKEFILE "\t\@echo I am \$(subst output,,\$@)\n";  
20 # END of Contents of MAKEFILE
22 close(MAKEFILE);
24 &touch("test.h");
26 &run_make_with_options($makefile,"bigoutput",&get_logfile);
29 # Create the answer to what should be produced by this Makefile
30 $answer = "I am big\n";
32 &compare_output($answer,&get_logfile(1));
34 &run_make_with_options($makefile,"littleoutput",&get_logfile);
35 $answer = "I am little\n";
36 &compare_output($answer,&get_logfile(1));
38 unlink "test.h";