3 $description = "The following tests the use of a PHONY target. It makes\n"
4 ."sure that the rules under a target get executed even if\n"
5 ."a filename of the same name of the target exists in the\n"
8 $details = "This makefile in this test declares the target clean to be a \n"
9 ."PHONY target. We then create a file named \"clean\" in the \n"
10 ."directory. Although this file exists, the rule under the target\n"
11 ."clean should still execute because of it's phony status.";
13 $example = "EXAMPLE_FILE";
15 open(MAKEFILE,"> $makefile");
17 # The Contents of the MAKEFILE ...
19 print MAKEFILE ".PHONY : clean \n";
20 print MAKEFILE "all: \n";
21 print MAKEFILE "\t\@echo This makefile did not clean the dir ... good\n";
22 print MAKEFILE "clean: \n";
23 print MAKEFILE "\t$delete_command $example clean\n";
25 # END of Contents of MAKEFILE
31 # Create a file named "clean". This is the same name as the target clean
32 # and tricks the target into thinking that it is up to date. (Unless you
33 # use the .PHONY target.
36 $answer = "$delete_command $example clean\n";
37 &run_make_with_options($makefile,"clean",&get_logfile);
43 &compare_output($answer,&get_logfile(1));