typo in doc
[Text-CSV_XS.git] / Makefile.PL
1 #!/usr/bin/perl
2
3 # Copyright PROCURA B.V. (c) 2006-2013 H.Merijn Brand
4
5 require 5.006001; # <- also see postamble at the bottom for META.yml
6 use strict;
7
8 use ExtUtils::MakeMaker;
9
10 my %wm = (
11     NAME         => "Text::CSV_XS",
12     DISTNAME     => "Text-CSV_XS",
13     ABSTRACT     => "Comma-Separated Values manipulation routines",
14     AUTHOR       => "H.Merijn Brand <h.merijn\@xs4all.nl>",
15     VERSION_FROM => "CSV_XS.pm",
16     PREREQ_PM    => { "DynaLoader"      => 0,
17                       "Config"          => 0,
18                       "IO::Handle"      => 0,
19                       "Test::More"      => 0,
20                       },
21     clean        => { FILES => join " ", qw(
22                          CSV_XS.c.gcov
23                          CSV_XS.gcda
24                          CSV_XS.gcno
25                          CSV_XS.xs.gcov
26                          cover_db
27                          valgrind.log
28                          )
29                       },
30
31     macro        => { GCC_WALL => (join " " => qw(
32                         -Wall -Wextra -Wbad-function-cast -Wcomment -Wcomments
33                         -Wformat -Wdisabled-optimization -Wmissing-prototypes
34                         -Werror-implicit-function-declaration -Wmissing-noreturn
35                         -Wmissing-format-attribute -Wno-cast-qual -Wunused-value
36                         -Wno-sign-compare -Wpointer-arith -Wreturn-type -Wshadow
37                         -Wswitch-default -Wuninitialized -Wunreachable-code
38                         -Wundef
39                         )),
40                       TARFLAGS   => "--format=ustar -c -v -f",
41                      "#OPTIMIZE" => "-O2 \$(GCC_WALL)",
42                     },
43     );
44 $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";
45
46 my $rv = WriteMakefile (%wm);
47
48 1;
49
50 package MY;
51
52 sub postamble
53 {
54     my $make_sep = $^O eq "VMS" ? "," : "";
55     my $valgrind = join " ", qw(
56         PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
57             valgrind
58                 --suppressions=sandbox/perl.supp
59                 --leak-check=yes
60                 --leak-resolution=high
61                 --show-reachable=yes
62                 --num-callers=50
63                 --log-fd=3
64                 $(FULLPERLRUN)
65                     "-MPerl::Destruct::Level=level,2"
66                     "-MExtUtils::Command::MM" "-e"
67                     "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
68                     $(TEST_FILES) 3>valgrind.log
69                     );
70
71     my $min_vsn = ($] >= 5.010 && -d "xt" && -d "tmp" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
72         ? join "\n" =>
73             'test ::',
74             '   -@env TEST_FILES="xt/*.t" make -e test_dynamic',
75             ''
76         : "";
77     join "\n" =>
78         'cover $make_sep test_cover:',
79         '       ccache -C',
80         '       -@rm -f *.gc??',
81         '       cover -test',
82         '',
83         'leakrun:',
84         '       env HARNESS_PERL=sandbox/leakperl make test',
85         '       -@tail -14 valgrind.log',
86         '',
87         'leakcheck:',
88         "       $valgrind",
89         '       -@tail -14 valgrind.log',
90         '',
91         'leaktest:',
92         q{      sandbox/leaktest  $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
93         '',
94         'leaktrace:',
95         q{      sandbox/leaktrace $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
96         '',
97         'spellcheck:',
98         '       pod-spell-check --aspell --ispell',
99         '',
100         'checkmeta:     spellcheck',
101         '       perl sandbox/genPPPort_h.pl',
102         '       perl sandbox/genMETA.pl -c',
103         '',
104         'fixmeta:       distmeta',
105         '       perl sandbox/genMETA.pl',
106         '',
107         'tgzdist:       checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
108         '       -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
109         '       -@cpants_lint.pl $(DISTVNAME).tgz',
110         '       -@rm -f Debian_CPANTS.txt',
111         '',
112         'test_speed: pure_all',
113         '       PERL_DL_NONLAZY=1 $(FULLPERLRUN) -I"$(INST_LIB)" -I"$(INST_ARCHLIB)" examples/speed.pl',
114         '',
115         $min_vsn;
116     } # postamble