### SPAR <http://www.cpan.org/scripts/>
### 1 644 1103317920 1336936334 is_relevant.pl
is_windows < 1 # Strawberry and ActiveState don't export empty vars
### 20 755 1100740057 1210256087 makepp_test_script.pl
$ENV{FOO} = '';
makepp qw(RUN=1 PARSER=foo);
c_cp 'a', 'a-1';
c_cp 'b', 'b-1';
c_cp 'c', 'c-1';
c_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 PARSER='Mpp::CommandParser::foo');
c_cp 'a', 'a-2';
c_cp 'b', 'b-2';
c_cp 'c', 'c-2';
c_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 PARSER=bar);
### 53 644 1289339760 1289339760 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 Mpp::CommandParser::foo;
our @ISA = qw/Mpp::CommandParser/;
sub xparse_command {
my $self = shift;
open(RESCAN, '>', "rescan") or die;
print RESCAN "yes\n";
close(RESCAN);
$self->add_env_dependency("FOO");
}
sub factory {
shift;
__PACKAGE__->new( @_ );
}
}
*p_bar = \&Mpp::CommandParser::foo::factory;
perl_end
a:
:env A
echo $$A $$RUN > $@
b:
:environment B
echo $$B $$RUN > $@
c: : env "f in MY_PATH"
echo $$RUN > $@
d: : parser $(PARSER) # try both class and function
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