###	SPAR <http://www.cpan.org/scripts/>
###	2	644	1381956736	1382127816	hint
Ccache at least up to version 3.1.9 is known to make this test die,
bug report https://bugzilla.samba.org/show_bug.cgi?id=8728 refers.
###	1	644	1329052295	1329052295	is_relevant.pl
have_cc
###	28	644	1099447329	1381956819	makepp_test_script.pl
local $ENV{CCACHE_DISABLE} = 1 if $ENV{AUTOMATED_TESTING}; # Else faile with hint to let user know.

makepp 'BUILD=1';

print "Checking that ./x exits nonzero...\n";
-x 'x' or die;
system './x' or die;

c_cp qw(targlist targlist-1);

# The x.o timestamp has to change, or else we might not rebuild x
wait_timestamp 'x.o';

makepp '--rm_stale';

c_cp qw(targlist targlist-2);

# Scanner removed the stale include file:
-f 'stale2' and die;

print "Checking that building a stale file results in an error...\n";
eval { makepp qw(--rm_stale stale) } and die;

c_echo '/* Repos */', '-orepos/stale1';

makepp qw(--rm_stale stale1);

1;
###	25	644	1099447411	1099447387	Makeppfile
repository repos

CFLAGS := -I inc

ifdef BUILD
$(phony default): stale1 stale2 repos/stale x targlist frail2
	perl {}
else
$(phony default): x targlist
	./x
endif

ifdef BUILD
stale$(foreach): : foreach 1 2
	&echo "/* $@ */" -o $@
endif

frail%: stale%
	&cp $< $@

targlist:
	&echo $(wildcard frail* stale*) -o $@

oldlist:
	&echo $(only_stale frail* stale*) -o $@
###	6	644	1099422033	1099421990	x.c
#define RETURN return 1
#include "stale2"

int main() {
    RETURN;
}
###	D	755	1099447412	1099447412	inc
###	2	644	1099422496	1099422491	inc/stale2
#undef RETURN
#define RETURN return 0
###	D	755	1099447412	1099447412	repos
###	7	644	1099421311	1099421301	repos/Makeppfile
$(phony default):
	perl {}

ifdef BUILD
stale:
	&echo $@ -o $@
endif
###	D	755	1099447412	1099447366	answers
###	1	644	1099447362	1099447333	answers/stale1
/* Repos */
###	1	644	1099447358	1099447329	answers/targlist-1
frail1 frail2 stale1 stale2
###	1	644	1099447362	1099447333	answers/targlist-2