in reply to Re: let Makefile.PL to do the Readme file for me -- new target?
in thread let Makefile.PL to do the Readme file for me -- new target?

 But AFAIK is makefile.pl only relevant when installing from CPAN on the client side.

AFAI-do, yes-and-no.

Makefile is my friend and assistant: it runs for me tests, benchmarks and, like Discipulus wants to do: creates a readme from pod in various formats. This is in the tradition of Autotools/automake. In which just one last target (of many): make dist will create a tarball of the project for distributing it to end-users with all dev-related files filtered out. (btw I usually add make push-git to spare me the grory task of interacting with that abomination called git.)

That means that, in this style, there are 2 makefiles, one for the developer and one for the end-user. The latter created automatically, so there is no need to maintain 2 makefiles actually. However, please correct me if I am wrong, but this is not the case with ExtUtils::MakeMaker which, as LanX points out, assumes or imposes that Makefile.PL is for the end-users' benefit only. Assuming that only *they* are the only lazy (or dumb or forgetfull) link in the project's development chain!

Now, if there was a competition for the most lazy developer I would lose it because I would be too busy crafting an automated system for submitting my entry with just make submit && make win ...

So, I claim back my right to laziness and chose to inflate Makefile.PL with targets that the end user will never want to use - (caveat: that entails the danger of exposing sensitive urls/passwords). Because I want to have a functional, development-stage, Makefile fit for my lazy lifestyle.

10 minutes EDIT: See Re: let Makefile.PL to do the Readme file for me -- new target? for an alternative which involves other tools.

bw, bliako

Replies are listed 'Best First'.
Re^3: let Makefile.PL to do the Readme file for me -- new target?
by hippo (Archbishop) on Jan 20, 2021 at 11:09 UTC

    Perhaps I am misunderstanding you, but what you have said sounds like a contradiction to me.

    You have mentioned the author-only targets (such as make dist) and these can be auto-generated by ExtUtils::MakeMaker but you subsequently say that this module "assumes or imposes that Makefile.PL is for the end-users' benefit only". That is clearly not the case.


    🦛

      Yes, my make dist refered to Autotools' which does creates an end-user, client-side, Makefile. Automatically.

      But since you mentioned make dist in the context of ExtUtils::MakeMaker, my question is whether it creates a new Makefile.PL tailored-made for the client-side. AFAIK it just copies verbatim the original Makefile.PL into a dist tarball. Which is not the functionality Autotools provides and I referred to. *Edit*: So nothing contradictory.

        my question is whether it creates a new Makefile.PL tailored-made for the client-side.

        No, it does not. The same Makefile.PL is (or if you prefer, "can be") used both by the author and by the end-user.


        🦛

      Hello hippo,

      maybe I'm confused by the context of this part of the thread (where Autottols has another makefile) but you said:

      > author-only targets (such as make dist)

      I supposed too this to be true but I'm very disappointed (not by you ;) to discover is not. I'm actually playing with my Makefile.PL to add functionalities only during the author phase (distinct from user phase) and to do this I have overridden dist target (also tried with distdir one).

      Actually I have this pattern:

      package MY; # so that "SUPER" works right sub dist { # SAVE WHAT RECEIVED BY THE ORIGINAL dist my $inherited = $_[0]->SUPER::dist(@_); my $ask_for_git = main::prompt ("*** CUSTOM *** Do you want to spe +cify a git repository?:"); if ( $ask_for_git =~ /^y/i ){ ...

      But for what I see the dist target is reached by the cpan client too:

      io@COMP:c>cpan . You are visiting the local directory '.' without lock, take care that concurrent processes do not do likewise +. CPAN: CPAN::SQLite loaded ok (v0.211) Database was generated on Sun, 24 Jan 2021 14:03:26 GMT You are visiting the local directory 'c:/ulisse/games-dice-roller-LazyMakefileOK/Games-Dice-Roller-0.04/G +ames-Dice-Roller-0.04/.' without lock, take care that concurrent processes do not do likewise +. c:/ulisse/games-dice-roller-LazyMakefileOK/Games-Dice-Roller-0.04/Ga +mes-Dice-Roller-0.04/. Has already been unwrapped into directory c:/ulisse/games-dice-rolle +r-LazyMakefileOK/Games-Dice-Roller-0.04/Games-Dice -Roller-0.04/. CPAN: CPAN::Meta::Requirements loaded ok (v2.140) CPAN: Parse::CPAN::Meta loaded ok (v2.150010) CPAN: CPAN::Meta loaded ok (v2.150010) CPAN: Module::CoreList loaded ok (v5.20170114_24) Configuring c:/ulisse/games-dice-roller-LazyMakefileOK/Games-Dice-Roll +er-0.04/Games-Dice-Roller-0.04/. with Makefile.PL CPAN: CPAN::Reporter loaded ok (v1.2018) Reporting via CPAN::Reporter is disabled for local directories Name "main::meta_merge_args" used only once: possible typo at Makefile +.PL line 38. Checking if your kit is complete... Warning: the following files are missing in your kit: debug.log MANIFEST.bak pm_to_blib Please inform the author. *** CUSTOM *** Do you want to specify a git repository?: ... C:\ulisse\perl5.24-64b\c\bin\dmake.exe install UNINST=1 -- OK

      I'd really prefere to use an already present target because of laziness: if I remember to make my_custom_target_do_readme I can also remember to make the readme by hand, no? :)

      Both dist and distdir are under ExtUtils::MakeMaker#Distribution-Support where is stated:

      > For authors of extensions MakeMaker provides several Makefile targets...

      Maybe the cpan client broke the rule? As side note cpan client has no verbose output and I did not found which steps it does to install a module.

      Thanks for reading.

      L*

      There are no rules, there are no thumbs..
      Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.