I am not convinced my example contains "shell" code.

My guess is that you are thinking it's "shell" code because it's using $(PERLRUN) to reference the variable. But $(PERLRUN) is a makefile variable/macro, not a shell variable. MakeMaker creates a plethora of useful macros in its generated Makefile, so that you have platform independent ways of running common linux-shell-style idioms. It's useful to skim through the auto-generated Makefile to see what's available, and how they define those commands. For example, $(ECHO) will run a command to print to the console, but it might not use your OS's builtin echo command, to avoid compatibility issues.

This super-simplified Makefile.PL works for me:

# dummy makefile use ExtUtils::MakeMaker; my %mm_args = ( 'NAME' => 'Dummy::Module', ); sub MY::postamble { return <<'__POSTAMBLE__'; pryrt :: $(ECHO) shell is set to "$(SHELL)" $(PERL) -V:myuname -V:make __POSTAMBLE__ } WriteMakefile( %mm_args );

then, at the command line, since I have a new enough Strawberry that it uses gmake, I run:

perl Makefile.PL gmake pryrt

with the output:

C:\Users\peter.jones\Downloads\TempData\perl>perl Makefile.PL Generating a gmake-style Makefile Writing Makefile for Dummy::Module Writing MYMETA.yml and MYMETA.json C:\Users\peter.jones\Downloads\TempData\perl>gmake pryrt "C:\USR\LOCAL\APPS\BERRYBREW\PERLS\SYSTEM\PERL\BIN\perl.exe" -l -e "bi +nmode STDOUT, qq{:raw}; print qq{@ARGV}" -- shell is set to "C:/Windo +ws/system32/cmd.exe" shell is set to C:/Windows/system32/cmd.exe "C:\USR\LOCAL\APPS\BERRYBREW\PERLS\SYSTEM\PERL\BIN\perl.exe" -V:myunam +e -V:make myuname='Win32 strawberry-perl 5.30.0.1 #1 Thu May 23 12:20:46 2019 x6 +4'; make='gmake';

Notice that the shell is listed as cmd.exe, but the build system is still properly handling $(ECHO) and $(PERL).

I know that I've done similar things with older Strawberry Perl versions (even as far back as v5.10) which used dmake instead of gmake, but I don't have that old of a Strawberry Perl that I can use while at $work, so I cannot prove it right now.

I don't have access to ActiveState Perl nor its build environment. If you want to continue exploring this path, I suggest you try that Makefile.PL and run the sequence with AS's build environment, to see what happens.


In reply to Re^5: dmake and bash on Win? by pryrt
in thread let Makefile.PL to do the Readme file for me -- new target? by Discipulus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.