# -*-mode: perl-*- $description = "Test GNU make's auto-reinvocation feature."; $details = "\ If the makefile or one it includes can be rebuilt then it is, and make is reinvoked. We create a rule to rebuild the makefile from a temp file, then touch the temp file to make it newer than the makefile."; $makefile2 = &get_tmpfile; $makefile_orig = &get_tmpfile; open(MAKEFILE,"> $makefile"); print MAKEFILE < $makefile3"); print MAKEFILE <<'EOM'; all: ; @echo hello a : b ; touch $@ b : c ; [ -f $@ ] || touch $@ c: ; touch $@ include $(F) EOM close(MAKEFILE); &touch('a','b'); sleep(2); &touch('c'); # First try with the file that's not updated "once removed" from the # file we're including. &run_make_with_options($makefile3, "F=a", &get_logfile, 0); $answer = "[ -f b ] || touch b\nhello\n"; &compare_output($answer,&get_logfile(1)); # Now try with the file we're not updating being the actual file we're # including: this and the previous one test different parts of the code. &run_make_with_options($makefile3, "F=b", &get_logfile, 0); $answer = "[ -f b ] || touch b\nhello\n"; &compare_output($answer,&get_logfile(1)); unlink('a','b','c'); # This tells the test driver that the perl test script executed properly. 1;