###	SPAR <http://www.cpan.org/scripts/>
###	11	755	1119219345	1231331952	makepp_test_script.pl
makepp qw(gone2 generated stale);
c_cp 'generated', 'generated-1';
c_cp 'stale', 'stale-1';

unlink 'gone';
eval { makepp qw(-k --rm-stale) };
c_cp 'generated', 'generated-2';
c_cp 'stale', 'stale-2';
-f 'subdir/foo' or die; # Verify that it wasn't spuriously removed by makepp

makepp qw(generated stale x STALE=1);
###	37	644	1151616989	1231331948	Makeppfile
$(phony default): *

perl_begin
    # Test that command line variables are accessible in Perl
    $MY_STALE = $makefile->expand_variable( 'STALE' );
perl_end

a: d
    &touch $@

ifndef STALE
 b:
    &touch $@
endif

register_input_suffix echo .x
d: d.x : parser c_compilation
    echo $< > $@

x:
    &echo $(MY_STALE) -o $@

# Fake makepp into thinking that '0' will be a directory
0/y:
    &touch $@

gone2: gone1
       &cp gone1 gone2

gone1: gone
       &cp gone gone1

generated:
    &echo $(only_generated *) -o $@

stale:
    &echo $(only_stale *) -o $@
###	0	644	1080781634	1080781634	c
###	2	644	1119219345	1080782214	d.x
#include "subdir/foo"
#include "0"
###	0	644	1231330532	1231330532	gone
###	D	755	1080782838	1080782836	subdir
###	4	644	1080782838	1080782836	subdir/Makeppfile
bar:
	&touch foo bar

prebuild bar
###	D	755	1080782838	1080782836	answers
###	1	644	1080782836	1080782836	answers/generated
a b d generated stale x
###	1	644	1080782836	1080782836	answers/generated-1
gone1 gone2
###	1	644	1080782836	1080782836	answers/generated-2
a b d generated gone1 gone2 stale
###	1	644	1080782836	1080782836	answers/stale
b
###	1	644	1080782836	1080782836	answers/stale-1

###	1	644	1080782836	1080782836	answers/stale-2

###	1	644	1080782836	1080782836	answers/x
1