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
|
$NetBSD: patch-aa,v 1.1 2009/01/23 11:03:27 seb Exp $
Avoid GNU make inference rules extension (applied upstream).
--- Makefile.PL.orig 2009-01-22 22:20:41.000000000 +0000
+++ Makefile.PL
@@ -130,9 +130,7 @@ sub is_maintainer {
sub get_pp_tests {
opendir my $dh, 't' or die "Cannot read t: $!";
- return map {
- File::Spec->catfile('t', "pp_${_}")
- } grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
+ return grep { $_ !~ /^99/ } grep {/^\d.+\.t$/} readdir $dh;
}
# This is EUMM voodoo
@@ -149,9 +147,17 @@ sub init {
package MY;
sub postamble {
- my $pp_tests = join q{ }, ::get_pp_tests();
+ my @test_files = ::get_pp_tests();
+ my $pp_tests = join q{ }, map { File::Spec->catfile('t', "pp_${_}") } @test_files;
+ my @pp_test_targets = join qq{\n}, map {
+ my $source = File::Spec->catfile('t', ${_});
+ File::Spec->catfile('t', "pp_${_}") . q{: }
+ . qq{$source t/header_pp.inc\n\t}
+ . q{$(NOECHO) $(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc }
+ . $source . q{ > $@} . qq{\n}
+ } @test_files;
my $test_dep = $::has_compiler && ::is_maintainer()
- ? 'pure_all :: pp_tests'
+ ? qq{pure_all :: pp_tests\n} . join qq{\n}, @pp_test_targets
: '';
return <<"EOM"
@@ -159,7 +165,5 @@ pp_tests: ${pp_tests}
${test_dep}
-t/pp_%: t/% t/header_pp.inc
-\t\$(NOECHO) \$(ABSPERLRUN) "-MExtUtils::Command" -e cat t/header_pp.inc \$< > \$@
EOM
}
|