1 $description = "The following tests the use of a PHONY target. It makes\n"
2 ."sure that the rules under a target get executed even if\n"
3 ."a filename of the same name of the target exists in the\n"
6 $details = "This makefile in this test declares the target clean to be a \n"
7 ."PHONY target. We then create a file named \"clean\" in the \n"
8 ."directory. Although this file exists, the rule under the target\n"
9 ."clean should still execute because of it's phony status.";
13 $delete_command = "delete_file";
17 $delete_command = "rm";
20 $example = "EXAMPLE_FILE";
22 open(MAKEFILE,"> $makefile");
24 # The Contents of the MAKEFILE ...
26 print MAKEFILE ".PHONY : clean \n";
27 print MAKEFILE "all: \n";
28 print MAKEFILE "\t\@echo This makefile did not clean the dir ... good\n";
29 print MAKEFILE "clean: \n";
30 print MAKEFILE "\t$delete_command $example clean\n";
32 # END of Contents of MAKEFILE
38 # Create a file named "clean". This is the same name as the target clean
39 # and tricks the target into thinking that it is up to date. (Unless you
40 # use the .PHONY target.
43 $answer = "$delete_command $example clean\n";
44 &run_make_with_options($makefile,"clean",&get_logfile);
46 &compare_output($answer,&get_logfile(1));