Home | History | Annotate | Line # | Download | only in targets
      1  1.1  christos #                                                                    -*-perl-*-
      2  1.1  christos 
      3  1.1  christos $description = "The following test creates a makefile to delete a \n"
      4  1.1  christos               ."file in the directory.  It tests to see if make will \n"
      5  1.1  christos               ."NOT execute the command unless the rule is given in \n"
      6  1.1  christos               ."the make command line.";
      7  1.1  christos 
      8  1.1  christos $example = "EXAMPLE_FILE";
      9  1.1  christos 
     10  1.1  christos open(MAKEFILE,"> $makefile");
     11  1.1  christos 
     12  1.1  christos # The Contents of the MAKEFILE ...
     13  1.1  christos 
     14  1.1  christos print MAKEFILE "all: \n";
     15  1.1  christos print MAKEFILE "\t\@echo This makefile did not clean the dir... good\n";
     16  1.1  christos print MAKEFILE "clean: \n";
     17  1.1  christos print MAKEFILE "\t$delete_command EXAMPLE_FILE\n";
     18  1.1  christos 
     19  1.1  christos # END of Contents of MAKEFILE
     20  1.1  christos 
     21  1.1  christos close(MAKEFILE);
     22  1.1  christos 
     23  1.1  christos &touch($example);
     24  1.1  christos 
     25  1.1  christos 
     26  1.1  christos &run_make_with_options($makefile,"",&get_logfile,0);
     27  1.1  christos 
     28  1.1  christos # Create the answer to what should be produced by this Makefile
     29  1.1  christos $answer = "This makefile did not clean the dir... good\n";
     30  1.1  christos 
     31  1.1  christos &compare_output($answer,&get_logfile(1)) || &error ("abort");
     32  1.1  christos 
     33  1.1  christos 
     34  1.1  christos $answer = "$delete_command $example\n";
     35  1.1  christos &run_make_with_options($makefile,"clean",&get_logfile,0);
     36  1.1  christos if (-f $example) {
     37  1.1  christos   $test_passed = 0;
     38  1.1  christos }
     39  1.1  christos &compare_output($answer,&get_logfile(1)) || &error ("abort");
     40  1.1  christos 
     41  1.1  christos 1;
     42  1.1  christos 
     43  1.1  christos 
     44  1.1  christos 
     45  1.1  christos 
     46  1.1  christos 
     47  1.1  christos 
     48  1.1  christos 
     49  1.1  christos 
     50  1.1  christos 
     51