| 1 |
# DO NOT EDIT! This file is written by perl_setup_dist. |
| 2 |
# If needed, you can add content at the end of the file. |
| 3 |
|
| 4 |
## no critic (Policy) |
| 5 |
|
| 6 |
use 5.026; |
| 7 |
use strict; |
| 8 |
use warnings; |
| 9 |
use ExtUtils::MakeMaker::CPANfile; |
| 10 |
|
| 11 |
WriteMakefile( |
| 12 |
NAME => 'Markdown::Perl', |
| 13 |
DISTNAME => 'Markdown-Perl', |
| 14 |
AUTHOR => q{Mathias Kende <[email protected]>}, |
| 15 |
VERSION_FROM => 'lib/Markdown/Perl.pm', |
| 16 |
ABSTRACT => q{Very configurable Markdown processor written in pure Perl, supporting the CommonMark spec and many extensions}, |
| 17 |
LICENSE => 'mit', |
| 18 |
EXE_FILES => ['script/pmarkdown',], |
| 19 |
MIN_PERL_VERSION => '5.026', |
| 20 |
MAN3PODS => {}, |
| 21 |
# Directories in which we look for Makefile.PL. In general could be omitted but is needed in case there |
| 22 |
# is a file named Makefile.PL in a sub-directory. Should be customized if such a file needs to be |
| 23 |
# processed by ExtUtils. |
| 24 |
DIR => [], |
| 25 |
META_MERGE => { |
| 26 |
'meta-spec' => { version => 2 }, |
| 27 |
dynamic_config => 0, |
| 28 |
no_index => { |
| 29 |
directory => [ 'local', 'vendor', 't' ], |
| 30 |
}, |
| 31 |
resources => { |
| 32 |
repository => { |
| 33 |
type => 'git', |
| 34 |
url => '[email protected]:mkende/pmarkdown.git', |
| 35 |
web => 'https://github.com/mkende/pmarkdown', |
| 36 |
}, |
| 37 |
bugtracker => { |
| 38 |
web => 'https://github.com/mkende/pmarkdown/issues', |
| 39 |
}, |
| 40 |
}, |
| 41 |
}, |
| 42 |
dist => { COMPRESS => 'gzip -9f', SUFFIX => '.gz', }, |
| 43 |
clean => { FILES => 'Markdown-Perl-*' }, |
| 44 |
); |
| 45 |
|
| 46 |
# These platforms (usually) have GNU Make by default so the syntax that we use |
| 47 |
# for our custom targets below will work (especially to export environment |
| 48 |
# variables). |
| 49 |
# On other platforms, we disable the custom parts of our Makefile generation, as |
| 50 |
# the generated Makefile would otherwise not parse correctly. |
| 51 |
sub supported_platform { |
| 52 |
return $^O =~ m/^(?:linux|cygwin|MSWin32)$/; |
| 53 |
} |
| 54 |
|
| 55 |
sub MY::postamble { |
| 56 |
my ($self) = @_; |
| 57 |
|
| 58 |
my @postamble; |
| 59 |
push @postamble, ::postamble() if *::postamble{CODE}; |
| 60 |
|
| 61 |
push @postamble, <<"MAKE_FRAGMENT" if supported_platform(); |
| 62 |
ALL_PM := \$(shell find lib -name "*.pm") |
| 63 |
ALL_EXE := script/pmarkdown |
| 64 |
|
| 65 |
.PHONY: distupload cover critic rawcritic tidy spelling alltest clean clean_coverdb pod2html exe |
| 66 |
|
| 67 |
distupload: distcheck disttest |
| 68 |
\t\$(MAKE) tardist |
| 69 |
\tcpan-upload --directory Dist-Setup \$(DISTVNAME).tar\$(SUFFIX) |
| 70 |
|
| 71 |
cover: |
| 72 |
\tcover -test |
| 73 |
|
| 74 |
critic: export EXTENDED_TESTING = 1 |
| 75 |
critic: all |
| 76 |
\tperl -Ilib t/001-perlcritic.t 2>&1 | less |
| 77 |
|
| 78 |
rawcritic: |
| 79 |
\tperlcritic lib script |
| 80 |
|
| 81 |
tidy: |
| 82 |
\tperltidy -b -bext='/' \$(ALL_PM) \$(ALL_EXE) |
| 83 |
|
| 84 |
spelling: export EXTENDED_TESTING = 1 |
| 85 |
spelling: |
| 86 |
\t\$(PERLRUN) t/001-spelling.t --interactive |
| 87 |
|
| 88 |
test: export HARNESS_OPTIONS = j8:c |
| 89 |
|
| 90 |
alltest: export EXTENDED_TESTING = 1 |
| 91 |
alltest: test |
| 92 |
|
| 93 |
clean:: clean_coverdb clean_build clean_pod2html |
| 94 |
|
| 95 |
clean_coverdb: |
| 96 |
\trm -fr cover_db |
| 97 |
|
| 98 |
clean_build: |
| 99 |
\trm -fr build |
| 100 |
|
| 101 |
clean_pod2html: |
| 102 |
\trm -fr pod2html |
| 103 |
|
| 104 |
PM_HTML := \$(patsubst %.pm, pod2html/%.html, \$(ALL_PM)) |
| 105 |
EXE_HTML := \$(patsubst %, pod2html/%.html, \$(ALL_EXE)) |
| 106 |
pod2html: \$(PM_HTML) \$(EXE_HTML) |
| 107 |
|
| 108 |
\$(PM_HTML): pod2html/%.html: %.pm |
| 109 |
\tmkdir -p \$(shell dirname \$@) |
| 110 |
\tpod2html --infile \$< --outfile \$@ |
| 111 |
|
| 112 |
\$(EXE_HTML): pod2html/%.html: % |
| 113 |
\tmkdir -p \$(shell dirname \$@) |
| 114 |
\tpod2html --infile \$< --outfile \$@ |
| 115 |
|
| 116 |
EXE_EXE := \$(patsubst %, build/%\$(EXE_EXT), \$(ALL_EXE)) |
| 117 |
|
| 118 |
exe: export PAR_VERBATIM=1 |
| 119 |
exe: build \$(EXE_EXE) |
| 120 |
|
| 121 |
build: |
| 122 |
\tmkdir -p build |
| 123 |
|
| 124 |
\$(EXE_EXE): build/%\$(EXE_EXT): % |
| 125 |
\tpp -o \$@ -cd build/pp.cache -c -I lib -F "PodStrip=.*\\bMarkdown/Perl\\b(*COMMIT)(*FAIL)|.*" \$< |
| 126 |
|
| 127 |
MAKE_FRAGMENT |
| 128 |
|
| 129 |
return join "\n", @postamble; |
| 130 |
} |
| 131 |
|
| 132 |
# You can add below this template a `postamble` sub that returns more content to |
| 133 |
# add to the generated Makefile. |
| 134 |
|
| 135 |
# End of the template. You can add custom content below this line. |
| 136 |
|
| 137 |
sub postamble { |
| 138 |
return unless supported_platform(); |
| 139 |
return <<"EOF"; |
| 140 |
profile: |
| 141 |
\t-perl -Ilib -d:NYTProf t/900-cmark-test-suite.t --fast |
| 142 |
\tnytprofhtml |
| 143 |
\t\@echo Profile is at `pwd`/nytprof/index.html |
| 144 |
|
| 145 |
clean:: clean_nytprof |
| 146 |
|
| 147 |
clean_nytprof: |
| 148 |
\trm -fr nytprof nytprof.out |
| 149 |
|
| 150 |
fuzzing: export MAXI_TEST = 1 |
| 151 |
fuzzing: |
| 152 |
\tperl -Ilib t/801-fuzzing.t |
| 153 |
|
| 154 |
EOF |
| 155 |
} |