1999-09-14 02:03:19 +00:00
|
|
|
# -*-perl-*-
|
|
|
|
$description = "Tests VPATH+/GPATH functionality.";
|
|
|
|
|
|
|
|
$details = "";
|
|
|
|
|
|
|
|
$VP = "$workdir$pathsep";
|
|
|
|
|
|
|
|
open(MAKEFILE,"> $makefile");
|
|
|
|
|
|
|
|
# The Contents of the MAKEFILE ...
|
|
|
|
|
|
|
|
print MAKEFILE "VPATH = $VP\n";
|
|
|
|
|
|
|
|
print MAKEFILE <<'EOMAKE';
|
|
|
|
|
|
|
|
GPATH = $(VPATH)
|
|
|
|
|
|
|
|
.SUFFIXES: .a .b .c .d
|
|
|
|
.PHONY: general rename notarget intermediate
|
|
|
|
|
|
|
|
%.a:
|
|
|
|
%.b:
|
|
|
|
%.c:
|
|
|
|
%.d:
|
|
|
|
|
|
|
|
%.a : %.b ; cat $^ > $@
|
|
|
|
%.b : %.c ; cat $^ > $@
|
|
|
|
%.c :: %.d ; cat $^ > $@
|
|
|
|
|
|
|
|
# General testing info:
|
|
|
|
|
|
|
|
general: foo.b
|
|
|
|
foo.b: foo.c bar.c
|
|
|
|
|
|
|
|
EOMAKE
|
|
|
|
|
|
|
|
close(MAKEFILE);
|
|
|
|
|
|
|
|
@touchedfiles = ();
|
|
|
|
|
2002-09-04 07:26:19 +00:00
|
|
|
$off = -500;
|
|
|
|
|
2020-11-29 21:02:12 +00:00
|
|
|
sub gtouchfiles {
|
1999-09-14 02:03:19 +00:00
|
|
|
foreach (@_) {
|
|
|
|
($f = $_) =~ s,VP/,$VP,g;
|
2002-09-04 07:26:19 +00:00
|
|
|
&utouch($off, $f);
|
|
|
|
$off += 10;
|
1999-09-14 02:03:19 +00:00
|
|
|
push(@touchedfiles, $f);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Run the general-case test
|
|
|
|
|
2020-11-29 21:02:12 +00:00
|
|
|
>ouchfiles("VP/foo.d", "VP/bar.d", "VP/foo.c", "VP/bar.c", "foo.b", "bar.d");
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
&run_make_with_options($makefile,"general",&get_logfile());
|
|
|
|
|
|
|
|
push(@touchedfiles, "bar.c");
|
|
|
|
|
2012-03-04 00:24:20 +00:00
|
|
|
$answer = "$make_name: Nothing to be done for 'general'.\n";
|
1999-09-14 02:03:19 +00:00
|
|
|
|
|
|
|
&compare_output($answer,&get_logfile(1));
|
|
|
|
|
|
|
|
unlink(@touchedfiles) unless $keep;
|
|
|
|
|
|
|
|
1;
|