###	SPAR <http://www.cpan.org/scripts/>
###	2	644	1103317920	1224089613	is_relevant.pl
is_windows < 1 &&		# Strawberry and ActiveState don't export empty vars
is_windows != -2		# Msys 5.6.1 dumps on delete from %ENV
###	20	755	1100740057	1210256087	makepp_test_script.pl
$ENV{FOO} = '';
makepp 'RUN=1';
cp 'a', 'a-1';
cp 'b', 'b-1';
cp 'c', 'c-1';
cp 'd', 'd-1';
rename 'rescan', 'rescan-1';

# a gets rebuilt, because $A goes from undef to ''
$ENV{A} = '';
makepp qw(B_VAL=b_val MY_PATH_VAL=.:nodir RUN=2);
cp 'a', 'a-2';
cp 'b', 'b-2';
cp 'c', 'c-2';
cp 'd', 'd-2';
rename 'rescan', 'rescan-2';

$ENV{A} = 'a';
delete $ENV{FOO};
makepp qw(B_VAL=b F_IN_DIR=1 RUN=3);
###	52	644	1100739927	1210850233	Makeppfile
$(phony default): a b c d

export RUN := $(RUN)

MY_PATH_VAL ?= .:dir
export MY_PATH := $(MY_PATH_VAL)

B_VAL ?= b_val
export B := $(B_VAL)

perl_begin
 open(RESCAN, '>', "rescan") or die;
 close(RESCAN);

 { package CommandParser::foo;
    our @ISA = qw/CommandParser/;
    sub xparse_command {
	my $self = shift;
	open(RESCAN, '>', "rescan") or die;
	print RESCAN "yes\n";
	close(RESCAN);
	$self->add_env_dependency("FOO");
    }
 }

 sub parser_foo {
    require ActionParser::Specific;
    return new ActionParser::Specific("foo");
 }
perl_end

a:
	:env A
	echo $$A $$RUN > $@

b:
	:environment B
	echo $$B $$RUN > $@

c: : env "f in MY_PATH"
	echo $$RUN > $@

d: : scanner foo
	echo $$RUN > $@

ifdef F_IN_DIR
 dir/f:
	&touch $@
else
 f:
	&touch $@
endif
###	D	755	1100740147	1100740140	answers
###	1	644	1100655058	1100655039	answers/a
a 3
###	1	644	1100655058	1100655039	answers/a-1
1
###	1	644	1100655058	1100655039	answers/a-2
2
###	1	644	1100655058	1100655039	answers/b
b 3
###	1	644	1100655058	1100655039	answers/b-1
b_val 1
###	1	644	1100655058	1100655039	answers/b-2
b_val 1
###	1	644	1100655058	1100655039	answers/c
3
###	1	644	1100655058	1100655039	answers/c-1
1
###	1	644	1100655058	1100655039	answers/c-2
1
###	1	644	1100740140	1100740140	answers/d
3
###	1	644	1100740140	1100740140	answers/d-1
1
###	1	644	1100740140	1100740140	answers/d-2
1
###	1	644	1100740140	1100740140	answers/rescan
yes
###	1	644	1100740140	1100740140	answers/rescan-1
yes
###	0	644	1100740140	1100740140	answers/rescan-2