1*69606e3fSchristos$description = "The following test creates a makefile to override part\n" 2*69606e3fSchristos ."of one Makefile with Another Makefile with the .DEFAULT\n" 3*69606e3fSchristos ."rule."; 4*69606e3fSchristos 5*69606e3fSchristos$details = "This tests the use of the .DEFAULT special target to say that \n" 6*69606e3fSchristos ."to remake any target that cannot be made fram the information\n" 7*69606e3fSchristos ."in the containing makefile, make should look in another makefile\n" 8*69606e3fSchristos ."This test gives this makefile the target bar which is not \n" 9*69606e3fSchristos ."defined here but passes the target bar on to another makefile\n" 10*69606e3fSchristos ."which does have the target bar defined.\n"; 11*69606e3fSchristos 12*69606e3fSchristos$makefile2 = &get_tmpfile; 13*69606e3fSchristos 14*69606e3fSchristosopen(MAKEFILE,"> $makefile"); 15*69606e3fSchristos 16*69606e3fSchristos# The Contents of the MAKEFILE ... 17*69606e3fSchristos 18*69606e3fSchristosprint MAKEFILE "foo:\n"; 19*69606e3fSchristosprint MAKEFILE "\t\@echo Executing rule FOO\n\n"; 20*69606e3fSchristosprint MAKEFILE ".DEFAULT:\n"; 21*69606e3fSchristosprint MAKEFILE "\t\@\$(MAKE) -f $makefile2 \$\@ \n"; 22*69606e3fSchristos 23*69606e3fSchristos# END of Contents of MAKEFILE 24*69606e3fSchristos 25*69606e3fSchristosclose(MAKEFILE); 26*69606e3fSchristos 27*69606e3fSchristos 28*69606e3fSchristosopen(MAKEFILE,"> $makefile2"); 29*69606e3fSchristos 30*69606e3fSchristosprint MAKEFILE "bar:\n"; 31*69606e3fSchristosprint MAKEFILE "\t\@echo Executing rule BAR\n\n"; 32*69606e3fSchristos 33*69606e3fSchristosclose(MAKEFILE); 34*69606e3fSchristos 35*69606e3fSchristos&run_make_with_options($makefile,'bar',&get_logfile); 36*69606e3fSchristos 37*69606e3fSchristos# Create the answer to what should be produced by this Makefile 38*69606e3fSchristos$answer = "${make_name}[1]: Entering directory `$pwd'\n" 39*69606e3fSchristos . "Executing rule BAR\n" 40*69606e3fSchristos . "${make_name}[1]: Leaving directory `$pwd'\n"; 41*69606e3fSchristos 42*69606e3fSchristos# COMPARE RESULTS 43*69606e3fSchristos 44*69606e3fSchristos&compare_output($answer,&get_logfile(1)); 45*69606e3fSchristos 46*69606e3fSchristos# This tells the test driver that the perl test script executed properly. 47*69606e3fSchristos1; 48*69606e3fSchristos 49*69606e3fSchristos 50*69606e3fSchristos 51*69606e3fSchristos 52*69606e3fSchristos 53*69606e3fSchristos 54