Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I have sent the following patch to the maintainer of ExtUtils-MakeMaker

diff -u -r t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/MakeMaker t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/ --- t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/ 2012-04-01 09:02:31.450034700 +0200 +++ t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/ 2012-04-01 09:03:05.508694300 +0200 @@ -620,17 +620,13 @@ $argv =~ s/^\[/(/; $argv =~ s/\]$/)/; + push @{$self->{RESULT}}, $self->makefile_head; push @{$self->{RESULT}}, <<END; -# This Makefile is for the $self->{NAME} extension to perl. -# -# It was generated automatically by MakeMaker version +# This file was generated automatically by MakeMaker version # $VERSION (Revision: $Revision) from the contents of # Makefile.PL. Don't edit this file, edit Makefile.PL instead. # -# ANY CHANGES MADE HERE WILL BE LOST! -# # MakeMaker ARGV: $argv -# END push @{$self->{RESULT}}, $self->_MakeMaker_Parameters_section(\%initial_att); diff -u -r t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/ t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/ --- t:/makeMaker/ExtUtils-MakeMaker-6.62/lib/ExtUtils/ 201 +2-04-01 09:05:27.800943800 +0200 +++ t:/makeMaker/ExtUtils-MakeMaker-modified/lib/ExtUtils/ 2012-04-01 09:09:10.771335900 +0200 @@ -382,6 +382,38 @@ return $make; } +=head2 Preludes + +These are methods which produce things early in the Makefile. + + +=head3 makefile_head + +Generate the head of the Makefile. + +=cut + +sub makefile_head { + my $self = shift; + + my $target_make_program_index = $self->is_make_type('dmake')? 1 : + $self->is_make_type('nmake')? 2 : 0; + my $target_make_program = ('make', 'dmake', 'nmake')[$target_make_program_index]; + my $sudo_prefix = ('sudo ', '', '')[$target_make_program_index]; + + return <<END; +# This Makefile is for the $self->{NAME} extension to perl. +# +# DO NOT EDIT! ANY CHANGES MADE IN THIS FILE WILL BE LOST! +# +# Typical usage: +# perl Makefile.PL +# ${target_make_program} +# ${target_make_program} test +# ${sudo_prefix}${target_make_program} install +# +END +} =head2 Targets

I have also ask for guidance where to add the following:

  1. Add these definition to (GNU)make and dmake Makefiles.
    It should be added EARLY in the Makefile.
    "Direct" call from the constructor or part of a section or a new MakeMaker section or ... ?
    # --- MakeMaker ???? section: ifeq "{xxx}" "xxx" MAKE_USED = dmake endif ifneq "$(.VARIABLES)" "" MAKE_USED = gnumake endif
  2. Add a snippet somewhere in Makefiles for nmake.
    It is a trap if other make programs are used
    !IF 0 This makefile is intended to be used by nmake !ENDIF
    Should this be a "direct" call from the constructor, a part of a section or a new MakeMaker section or ... ?
  3. Add the target check_run_conditions to the top targets
    # --- MakeMaker top_targets section: all :: check_run_conditions pure_all $(NOECHO) $(NOOP)
    Probably modification of the method all_target in and
  4. Add the actions for target check_run_conditions
    The code will look something like:
    push @{$self->{RESULT}}, '', '# --- MakeMaker check_run_conditions section:', 'check_run_conditions ::'; if($target_make_program eq 'make'){ push @{$self->{RESULT}}, 'ifeq "$(MAKE_USED)" "dmake"', '# Note! The message is NOT sent to STDERR', ' $(NOECHO)echo ERROR: Using $(MAKE_USED) for a Makefile intended for ' .${target_make_program}, ' $(assign ERR OR = ERROR) #Generates an error message', 'endif'; } if($target_make_program eq 'dmake'){ push @{$self->{RESULT}}, 'ifeq "$(MAKE_USED)" "gnumake"', ' $(NOECHO)$(error ERROR: Using $(MAKE_USED) for a Makefile intended for ' .${target_make_program}.'.)', 'endif'; } “otherwise” { push @{$self->{RESULT}}, ' $(NOECHO) $(NOOP)'; }
    Should this be a part of a section or a new MakeMaker section or ?
For background see also Ideas on more foolproof Makefile.PL and generated Makefile.

In reply to Re^3: Problem installing Carp-1.25 under DWIM Perl by bojinlund
in thread Problem installing Carp-1.25 under DWIM Perl by HelenCr

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others perusing the Monastery: (5)
    As of 2017-01-17 21:33 GMT
    Find Nodes?
      Voting Booth?
      Do you watch meteor showers?

      Results (158 votes). Check out past polls.