Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: let Makefile.PL to do the Readme file for me -- new target?

by LanX (Saint)
on Jan 20, 2021 at 17:09 UTC ( [id://11127153]=note: print w/replies, xml ) Need Help??


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?

> See Win32::Mechanize::NotepadPlusPlus::Makefile.PL for an example of a bunch of extra targets

With the help of https://makefiletutorial.com/ I was able to decipher, well at least get an idea of what is happening.

We use a

Perlmodule to build a makefile with embedded rules in here-docs snippets

And those makefile rules embed

  • a macro syntax
  • a variable syntax
  • plus bash code

So to be runnable on other plattforms we need

  • a make program
  • a bash emulation

Doesn't sound like a very efficient way to have a file-timestamp-dependency system in Perl.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re^2: let Makefile.PL to do the Readme file for me -- new target?

Replies are listed 'Best First'.
Re^3: let Makefile.PL to do the Readme file for me -- new target?
by pryrt (Abbot) on Jan 20, 2021 at 17:45 UTC
    Rolf, no offense meant, but you seem to want this to be difficult; it's really not.

    For example, did you notice the name of that module: it starts with "Win32"? The solution I showed functions perfectly in Strawberry Perl on Windows, out of the box.

    Strawberry gives you the gcc build environment, with dmake (older strawberries) or gmake (newer strawberries) with perl -V:make showing the make variant to use. No extra work on your part. No bash emulation needed.

    Using a perl module to build a makefile is part of the standard ExtUtils::MakeMaker environment.

    Data::IEEE754::Tools Makefile.PL shows similar syntax, with the same syntax working on both Windows and Linux environments.

    Using the Makefile.PL -> Makefile to add extra targets, to automate extra things for development, is an intended use of the ExtUtils::MakeMaker environment. If you don't like it, that's your perogative; you don't have to use it. But it is a system that works, even on Windows with Strawberry Perl.

      I have to apologize if you had the impression I was criticizing your code. Sorry. :/

      It's a great peace of work showing a lot of nifty automization.

      I replied to you in this thread because you offered an elaborated example.

      What I meant was the whole concept, to use Perl to create two extra layers of different languages.

      It feels like embedding Sed to create Awk to me.

      Those levels of indirection must lead to problems.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      edit

      s/atomization/automization/

        Understood.

        It might be an extra level or two, but it's been working for ExtUtils::MakeMaker, even on Windows, at least as far back as 2002, and making use of the Makefile generated from a perl Makefile.PL is part of their design philosophy.

        I know other similar tools make use of a ./Build.PL, but I haven't used that toolset, so don't know if that idiom has an intermediate step as well, or not.

        Since I had some experience in automating README and similar tasks using MakeMaker for my few distros, I figured I'd share that knowledge.

      > Strawberry ... No extra work on your part. No bash emulation needed.

      Does it also work with ActiveState "without extra work" or do I need to install bash there?

      (in continuation of Re^2: dmake and bash on Win?)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11127153]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 12:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found