###	SPAR <http://www.cpan.org/scripts/>
###	19	644	1161580578	1220024351	makepp_test_script.pl
open my $x, '>res';

sub reptest {
  eval { &makepp };
  print $x "-\n";
  -f and print $x $_ . (stat _)[7] . "\n" or
  -l and print $x "$_ -> " . readlink() . "\n"
    for qw'a al b bl c cl dir/d e el fl';
}

makepp qw(-Crep default -C../rep1 default);
reptest '-Rrep';
unlink 'rep/a', 'rep/e', 'f';	# Make a disappear and preexisting fl stale.
reptest qw(--dont-read=rep1/a --dont-read=rep1/dir -Rrep1 -Rrep);
unlink 'rep/c';			# Make c and cl stale.
reptest qw(--rm-stale-files -Rrep);
reptest '--rm-stale-files';

close $x;
###	8	644	1159480520	1219830903	Makeppfile
$(phony default): ? ?l dir/*

e el:				# Also test both created in one rule.
	&cp b e
	&ln -fs $(outputs)

%l: %
	&ln -fs $(input) $(output)
###	0	644	1080844382	1080844382	f
###	L	S	0	0	fl
f
###	D	755	1080844589	1080844382	rep
###	L	S	0	0	rep/Makeppfile
../Makeppfile
###	0	644	1080844382	1080844382	rep/a
###	0	644	1080844382	1080844382	rep/b
###	0	644	1211984169	1211984169	rep/c
###	D	755	1211984169	1211984169	rep/dir
###	0	644	1211984169	1211984169	rep/dir/d
###	0	644	1080844382	1080844382	rep/e
###	D	755	1211984169	1211984169	rep1
###	L	S	0	0	rep1/Makeppfile
../Makeppfile
###	-1	644	1211984169	1211984169	rep1/a
x
###	-1	644	1211984169	1211984169	rep1/b
x
###	D	755	1211984169	1211984169	rep1/dir
###	-1	644	1211984169	1211984169	rep1/dir/d
x
###	-1	644	1080844382	1080844382	rep/e
x
###	D	755	1080845081	1080844879	answers
###	29	644	1161580578	1231320028	answers/res
-
a0
al0
b0
bl0
c0
cl0
dir/d0
e0
el0
fl0
-
al -> a
b1
bl1
c0
cl0
dir/d0
e1
el1
-
b0
bl0
dir/d0
e0
el0
-
e0
el0