Make `perl Makefile.PL` runs more user friendly - better diagnostics
[dbsrgits/DBIx-Class.git] / maint / Makefile.PL.inc / 52_autogen_README.pl
index 8914211..0f4a38c 100644 (file)
@@ -1,23 +1,21 @@
-# When a long-standing branch is updated a README may still inger around
+# When a long-standing branch is updated a README may still linger around
 unlink 'README' if -f 'README';
 
 # Makefile syntax allows adding extra dep-specs for already-existing targets,
 # and simply appends them on *LAST*-come *FIRST*-serve basis.
 # This allows us to inject extra depenencies for standard EUMM targets
 
+require File::Spec;
+my $dir = File::Spec->catdir(qw(maint .Generated_Pod));
+my $fn = File::Spec->catfile($dir, 'README');
+
 postamble <<"EOP";
 
 clonedir_generate_files : dbic_clonedir_gen_readme
 
-clonedir_cleanup_generated_files : dbic_clonedir_cleanup_readme
-
 dbic_clonedir_gen_readme :
-\tpod2text lib/DBIx/Class.pm > README
-
-dbic_clonedir_cleanup_readme :
-\t\$(RM_F) README
-
-realclean :: dbic_clonedir_cleanup_readme
+\t@{[ $mm_proto->oneliner('mkpath', ['-MExtUtils::Command']) ]} $dir
+\tpod2text lib/DBIx/Class.pm > $fn
 
 EOP