Add Text::CSV::Slurp to "SEE ALSO"
[Text-CSV_XS.git] / Makefile.PL
1 #!/usr/bin/perl
2
3 # Copyright PROCURA B.V. (c) 2006-2014 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.m.brand\@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                          pod2htmd.tmp
29                          )
30                       },
31
32     macro        => { GCC_WALL => (join " " => qw(
33                         -Wall -Wextra -Wbad-function-cast -Wcomment -Wcomments
34                         -Wformat -Wdisabled-optimization -Wmissing-prototypes
35                         -Werror-implicit-function-declaration -Wmissing-noreturn
36                         -Wmissing-format-attribute -Wno-cast-qual -Wunused-value
37                         -Wno-sign-compare -Wpointer-arith -Wreturn-type -Wshadow
38                         -Wswitch-default -Wuninitialized -Wunreachable-code
39                         -Wundef
40                         )),
41                       TARFLAGS   => "--format=ustar -c -v -f",
42                      "#OPTIMIZE" => "-O2 \$(GCC_WALL)",
43                     },
44     );
45 $ExtUtils::MakeMaker::VERSION > 6.30 and $wm{LICENSE} = "perl";
46
47 my $rv = WriteMakefile (%wm);
48
49 1;
50
51 package MY;
52
53 sub postamble
54 {
55     my $make_sep = $^O eq "VMS" ? "," : "";
56     my $valgrind = join " ", qw(
57         PERL_DESTRUCT_LEVEL=2 PERL_DL_NONLAZY=1
58             valgrind
59                 --suppressions=sandbox/perl.supp
60                 --leak-check=yes
61                 --leak-resolution=high
62                 --show-reachable=yes
63                 --num-callers=50
64                 --log-fd=3
65                 $(FULLPERLRUN)
66                     "-MPerl::Destruct::Level=level,2"
67                     "-MExtUtils::Command::MM" "-e"
68                     "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')"
69                     $(TEST_FILES) 3>valgrind.log
70                     );
71
72     my $min_vsn = ($] >= 5.010 && -d "xt" && -d "tmp" && ($ENV{AUTOMATED_TESTING} || 0) != 1)
73         ? join "\n" =>
74             'test ::',
75             '   -@env TEST_FILES="xt/*.t" make -e test_dynamic',
76             ''
77         : "";
78     my $no_inc = join " " => map { "-ignore $_" } grep { -s $_ }
79         map { "$_/CORE/inline.h" } @INC;
80     join "\n" =>
81         'cover $make_sep test_cover:',
82         '       ccache -C',
83         '       -@rm -f *.gc??',
84         '       cover -test',
85         "       cover -report html_basic $no_inc",
86         '',
87         'leakrun:',
88         '       env HARNESS_PERL=sandbox/leakperl make test',
89         '       -@tail -14 valgrind.log',
90         '',
91         'leakcheck:',
92         "       $valgrind",
93         '       -@tail -14 valgrind.log',
94         '',
95         'leaktest:',
96         q{      sandbox/leaktest  $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
97         '',
98         'leaktrace:',
99         q{      sandbox/leaktrace $(FULLPERLRUN) "test_harness($(TEST_VERBOSE), '$(INST_LIB)', '$(INST_ARCHLIB)')" $(TEST_FILES)},
100         '',
101         'spellcheck:',
102         '       pod-spell-check --aspell --ispell',
103         '',
104         'checkmeta:     spellcheck',
105         '       perl sandbox/genPPPort_h.pl',
106         '       perl sandbox/genMETA.pl -c',
107         '',
108         'fixmeta:       distmeta',
109         '       perl sandbox/genMETA.pl',
110         '',
111         'tgzdist:       checkmeta fixmeta $(DISTVNAME).tar.gz distcheck',
112         '       -@mv -f $(DISTVNAME).tar.gz $(DISTVNAME).tgz',
113         '       -@cpants_lint.pl $(DISTVNAME).tgz',
114         '       -@rm -f Debian_CPANTS.txt',
115         '       -@echo "Consider running sandbox/used-by.pl now"',
116         '',
117         'test_speed: pure_all',
118         '       PERL_DL_NONLAZY=1 $(FULLPERLRUN) -I"$(INST_LIB)" -I"$(INST_ARCHLIB)" examples/speed.pl',
119         '',
120         'test_used:     test',
121         '       prove -vwb sandbox/used-by.pl',
122         '',
123         $min_vsn;
124     } # postamble