###	SPAR <http://www.cpan.org/scripts/>
###	1	775	1168790726	1329052044	is_relevant.pl
have_cc and is_windows ? makepp( '-n' ) : 1; # Let makepp test if it uses a symlink capable compiler.
###	61	644	1159479798	1381667483	makepp_test_script.pl
sub sed_17($) {
  # Make sure that the foo.c timestamp changes
  wait_timestamp 'foo.c';

  c_sed "s/17/$_[0]/", 'foo/f.c', '-ofoo/foo.c';
}

sub from_rep($) {
  c_cp 'foo/bar/x', $_[0];
  open my $in, 'foo/bar/.makepp/foo.c.mk';
  /FROM_REPOSITORY/ and return while <$in>;

  open my $out, ">>$_[0]";
  print $out "No repository\n";
}

c_cp qw(M foo/Makeppfile);
makepp qw(-R foo/bar=foo foo/bar/nothing);

unlink 'foo/Makeppfile';
makepp qw(-R foo/bar=foo);

c_cp qw(M foo/Makeppfile);
c_cp qw(foo/f.c foo/foo.c);
makepp qw(-R foo/bar=foo foo/bar/x);

from_rep 'x0';

sed_17 18;
makepp qw(-R foo/bar=foo foo/bar/x);

from_rep 'x1';

makepp \'clean', '--only-repository-links', 'foo/bar';
c_cp qw(foo/f.c foo/foo.c);	# If we had not just cleaned, this would sometimes invalidate foo/bar/foo.c!
wait_timestamp 'foo/bar/foo';
makepp 'foo/x';

wait_timestamp 'foo/foo', 'foo/bar/foo';
# This should pick up x from foo/
makepp qw(-R foo/bar=foo foo/bar/x);

from_rep 'x2';

sed_17 18;
# Don't check signatures (\''), because foo/bar/* is out of date
makepp \'', 'foo/x';
makepp \'clean', '--only-repository-links', 'foo/bar';

# This should pick up x from foo/
makepp qw(-R foo/bar=foo foo/bar/x);

from_rep 'x3';

sed_17 19;
# Now it should recompile, but still remember that foo.c comes from a repos
makepp qw(-R foo/bar=foo foo/bar/x);

from_rep 'x4';

1;
###	5	644	1077141637	1186229250	Makeppfile
$(phony x):

iftrue $(filter %cl %cl.exe %bcc32 %bcc32.exe, $(CC))
  perl { die }
endif
###	5	644	1077143366	1077143363	M
$(phony nothing):
	@perl {}

x: foo
	.$/foo > $@
###	D	755	1077216823	1077216823	foo
###	5	644	1077143391	1077143389	foo/f.c
#include <stdio.h>
int main() {
	printf("17\n");
	return 0;
}
###	D	755	1077216767	1077216766	foo/bar
###	D	755	1077216766	1077216761	answers
###	1	644	1077144030	1077144018	answers/x0
17
###	1	644	1077144030	1077144018	answers/x1
18
###	1	644	1077216767	1077216761	answers/x2
17
###	1	644	1077216767	1077216761	answers/x3
18
###	1	644	1077216767	1077216761	answers/x4
19