1 # -*-mode: perl; rm-trailing-spaces: nil-*-
3 $description = "Test various forms of the GNU make `include' command.";
5 $details = "Test include, -include, sinclude and various regressions involving them.
6 Test extra whitespace at the end of the include, multiple -includes and
7 sincludes (should not give an error) and make sure that errors are reported
8 for targets that were also -included.";
10 $makefile2 = &get_tmpfile;
12 open(MAKEFILE,"> $makefile");
14 # The contents of the Makefile ...
17 \#Extra space at the end of the following file name
19 all: ; \@echo There should be no errors for this makefile.
21 -include nonexistent.mk
22 -include nonexistent.mk
23 sinclude nonexistent.mk
24 sinclude nonexistent-2.mk
34 open(MAKEFILE,"> $makefile2");
36 print MAKEFILE "ANOTHER: ; \@echo This is another included makefile\n";
40 # Create the answer to what should be produced by this Makefile
41 &run_make_with_options($makefile, "all", &get_logfile);
42 $answer = "There should be no errors for this makefile.\n";
43 &compare_output($answer, &get_logfile(1));
45 &run_make_with_options($makefile, "ANOTHER", &get_logfile);
46 $answer = "This is another included makefile\n";
47 &compare_output($answer, &get_logfile(1));
49 # Try to build the "error" target; this will fail since we don't know
50 # how to create makeit.mk, but we should also get a message (even though
51 # the -include suppressed it during the makefile read phase, we should
52 # see one during the makefile run phase).
54 # The fix to this caused more problems than the error, so I removed it.
57 #&run_make_with_options($makefile, "error", &get_logfile, 512);
58 #$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n";
59 #&compare_output($answer, &get_logfile(1));