diff options
author | Paul Smith <psmith@gnu.org> | 1999-09-14 02:03:19 +0000 |
---|---|---|
committer | Paul Smith <psmith@gnu.org> | 1999-09-14 02:03:19 +0000 |
commit | 0d366b668244112846554c42045ff1d9956276ed (patch) | |
tree | 3802242fe18a5e90d889f5d1ac66fb487361888b /tests/scripts/targets/DEFAULT | |
parent | 4121dea6a59367b4431cbe7a3c43d74fec9fd832 (diff) | |
download | gunmake-0d366b668244112846554c42045ff1d9956276ed.tar.gz |
* Added the test suite to the main distribution.
Diffstat (limited to 'tests/scripts/targets/DEFAULT')
-rw-r--r-- | tests/scripts/targets/DEFAULT | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/scripts/targets/DEFAULT b/tests/scripts/targets/DEFAULT new file mode 100644 index 0000000..0cabde9 --- /dev/null +++ b/tests/scripts/targets/DEFAULT @@ -0,0 +1,53 @@ +$description = "The following test creates a makefile to override part\n" + ."of one Makefile with Another Makefile with the .DEFAULT\n" + ."rule."; + +$details = "This tests the use of the .DEFAULT special target to say that \n" + ."to remake any target that cannot be made fram the information\n" + ."in the containing makefile, make should look in another makefile\n" + ."This test gives this makefile the target bar which is not \n" + ."defined here but passes the target bar on to another makefile\n" + ."which does have the target bar defined.\n"; + +$makefile2 = &get_tmpfile; + +open(MAKEFILE,"> $makefile"); + +# The Contents of the MAKEFILE ... + +print MAKEFILE "foo:\n"; +print MAKEFILE "\t\@echo Executing rule FOO\n\n"; +print MAKEFILE ".DEFAULT:\n"; +print MAKEFILE "\t\@\$(MAKE) -f $makefile2 \$\@ \n"; + +# END of Contents of MAKEFILE + +close(MAKEFILE); + + +open(MAKEFILE,"> $makefile2"); + +print MAKEFILE "bar:\n"; +print MAKEFILE "\t\@echo Executing rule BAR\n\n"; + +close(MAKEFILE); + +&run_make_with_options($makefile,'bar',&get_logfile); + +# Create the answer to what should be produced by this Makefile +$answer = "${make_name}[1]: Entering directory `$pwd'\n" + . "Executing rule BAR\n" + . "${make_name}[1]: Leaving directory `$pwd'\n"; + +# COMPARE RESULTS + +&compare_output($answer,&get_logfile(1)); + +# This tells the test driver that the perl test script executed properly. +1; + + + + + + |