1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
|
### SPAR <http://www.cpan.org/scripts/>
### 29 644 1161580578 1231322001 makepp_test_script.pl
# Test all variants of existing and created symlinks, to existing and created files.
makepp;
my %warnings;
n_files 'n_files1', sub {
undef $warnings{$1} if
/warning:.*?(is a symbolic link|I attempted to build|\w+ is probably also phony|There is no rule to build inexistent.+)/;
};
die if 5 != keys %warnings;
unlink qw(a bl f g h); # Force rebuild of linkee or make link stale.
wait_timestamp qw(c e);
for my $file (qw(c e)) { # Edit linkees.
open my $fh, '>', $file or die "$file--$!";
close $fh;
}
eval { makepp qw(D=dd -k) }; # [a-e]l2 and dl must not be rebuilt!
%warnings = ();
n_files 'n_files2', sub {
undef $warnings{$1} if
/warning:(.*)/;
};
die unless 1 == keys %warnings;
makepp qw(--rm-stale D=dd);
die if grep -f, qw(fl fl2 fc gl gl2 gc hl hl2 hc);
1;
### 32 644 1230569382 1304538479 Makeppfile
default: default1 # Provoke inexistent warnings.
default1: default2
default2: default3 # Provoke no-phony warnings.
@&expr 1
default3: ?c
@&expr 1
$(foreach) $(foreach)l: :foreach a b # Both created in one rule.
&echo $(output) -o $(output)
&ln -fs $(outputs)
%l: %
&ln -fs $(input) $(output)
%l2: %l
&ln -fs $(input) $(output)
%c: %l2 :signature md5
&cp $(input) $(output)
cl:
&echo $(output) -o $(output) # Should warn about link to c.
D=d
d:
&echo $D -o $(output)
%l: %
&ln -fs $(input) $(output)
### 0 644 1230569045 1230571314 c
### L S 0 0 cl
c
### 1 644 1230569045 1230569045 e
e
### 1 644 1230569045 1230569045 f
f
### 1 644 1230569045 1230569045 g
g
### L S 0 0 gl
g
### 1 644 1230569045 1230569045 h
h
### D 755 1230569356 1230569356 answers
### 1 644 1230569356 1230569356 answers/n_files1
27 4 0
### 1 644 1230569356 1230569356 answers/n_files2
9 0 3
### 1 644 1230569356 1230569356 answers/n_files
0 4 0
|