WriteMakefile(
NAME => 'Moose',
test => { TESTS => 't/*.t t/*/*.t' },
- MMHelper::mm_args(q{.}),
+ MMHelper::mm_args('dev'),
);
use File::Basename qw( dirname );
sub mm_args {
- my $root = shift;
+ my $is_dev = shift;
my $ccflags = ( $Config::Config{ccflags} || '' ) . ' -I.';
- $ccflags .= ' -Wall -Wdeclaration-after-statement';
+ $ccflags .= ' -Wall -Wdeclaration-after-statement'
+ if $is_dev;
my %mm = ( CCFLAGS => $ccflags );
my ( @object, %xs );
- for my $xs ( glob "$root/xs/*.xs" ) {
+ for my $xs ( glob "xs/*.xs" ) {
( my $c = $xs ) =~ s/\.xs$/.c/i;
( my $o = $xs ) =~ s/\.xs$/\$(OBJ_EXT)/i;
push @object, $o;
}
- for my $c ( glob "$root/*.c" ) {
+ for my $c ( glob "*.c" ) {
( my $o = $c ) =~ s/\.c$/\$(OBJ_EXT)/i;
push @object, $o;
}
sub my_package_subs {
return <<'EOP';
+{
package MY;
use Config;
$(OBJECT) : mop.h
EOF
}
+}
EOP
}
use Moose;
+use lib 'inc';
+
use MMHelper;
-with 'Dist::Zilla::Role::';
+extends 'Dist::Zilla::Plugin::MakeMaker::Awesome';
+
+override _build_MakeFile_PL_template => sub {
+ my $self = shift;
+
+ my $tmpl = super();
+
+ return $tmpl . "\n\n" . MMHelper::my_package_subs();
+};
+
+override _build_WriteMakefile_args => sub {
+ my $self = shift;
+
+ my $args = super();
+
+ return {
+ %{$args},
+ MMHelper::mm_args(),
+ };
+};
+
+1;
+
+
+