Skip to content

Commit

Permalink
Cleanup the generated Makefile on platforms without GNU Make. Bump th…
Browse files Browse the repository at this point in the history
…e version to 1.04.
  • Loading branch information
mkende committed May 9, 2024
1 parent 7a1e2ee commit a2487f4
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 7 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
Revision history for pmarkdown and the Markdown::Perl module.

1.04 - 2024-05-09

- Remove our custom make targets on platforms that don’t have GNU Make to
avoid parse failures.

1.03 - 2024-04-10

- Disable hard line breaks using two spaces in our default syntax because they
Expand Down
18 changes: 13 additions & 5 deletions Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,22 @@ WriteMakefile(
clean => { FILES => 'Markdown-Perl-*' },
);

# These platforms (usually) have GNU Make by default so the syntax that we use
# for our custom targets below will work (especially to export environment
# variables).
# On other platforms, we disable the custom parts of our Makefile generation, as
# the generated Makefile would otherwise not parse correctly.
sub supported_platform {
return $^O =~ m/^(?:linux|cygwin|MSWin32)$/;
}

sub MY::postamble {
my ($self) = @_;

my @postamble;
push @postamble, ::postamble() if *::postamble{CODE};

# Solaris has a weird (?) make that does not support our `export` statements.
push @postamble, <<"MAKE_FRAGMENT" unless $^O eq 'solaris';
push @postamble, <<"MAKE_FRAGMENT" if supported_platform();
ALL_PM := \$(shell find lib -name "*.pm")
ALL_EXE := script/pmarkdown
Expand All @@ -79,6 +87,8 @@ spelling: export EXTENDED_TESTING = 1
spelling:
\t\$(PERLRUN) t/001-spelling.t --interactive
test: export HARNESS_OPTIONS = j8:c
alltest: export EXTENDED_TESTING = 1
alltest: test
Expand Down Expand Up @@ -127,7 +137,7 @@ MAKE_FRAGMENT
# End of the template. You can add custom content below this line.

sub postamble {
return if $^O eq 'solaris';
return unless supported_platform();
return <<"EOF";
profile:
\t-perl -Ilib -d:NYTProf t/900-cmark-test-suite.t --fast
Expand All @@ -139,8 +149,6 @@ clean:: clean_nytprof
clean_nytprof:
\trm -fr nytprof nytprof.out
test: export HARNESS_OPTIONS = j8:c
fuzzing: export MAXI_TEST = 1
fuzzing:
\tperl -Ilib t/801-fuzzing.t
Expand Down
2 changes: 2 additions & 0 deletions dist_setup.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
exe_files => ['script/pmarkdown'],
min_perl_version => '5.026',

test_harness_options => 'j8:c',

author => {
name => 'Mathias Kende',
email => '[email protected]',
Expand Down
2 changes: 1 addition & 1 deletion lib/App/pmarkdown.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use warnings;

use Markdown::Perl;

our $VERSION = '1.03'; # Remember to also set the Markdown::Perl version.
our $VERSION = '1.04'; # Remember to also set the Markdown::Perl version.

1;

Expand Down
2 changes: 1 addition & 1 deletion lib/Markdown/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use Scalar::Util 'blessed';

use parent 'Markdown::Perl::Options';

our $VERSION = '1.03'; # Remember to also set the App::pmarkdown version.
our $VERSION = '1.04'; # Remember to also set the App::pmarkdown version.

our @EXPORT_OK = qw(convert set_options);
our %EXPORT_TAGS = (all => \@EXPORT_OK);
Expand Down

0 comments on commit a2487f4

Please sign in to comment.