Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Makefile caveat: tabs not spaces

by afoken (Chancellor)
on Jan 20, 2021 at 23:16 UTC ( [id://11127172]=note: print w/replies, xml ) Need Help??


in reply to Makefile caveat: tabs not spaces
in thread let Makefile.PL to do the Readme file for me -- new target?

But in M$-windows system dmake probably made a compromise? Or it's run with special command-line flags?

dmake uses a syntax that looks a little bit like GNU make, but it has some nasty differences. Quoting its man page:

dmake is not compatible with GNU Make. In particular it does not understand GNU Make's macro expansions that query the file system.

dmake is fully compatible with SYSV AUGMAKE

And yes, dmake can use spaces instead of tabs:

OPTIONS

[...]

-B
Enable the use of spaces instead of <tabs> to begin recipe lines. This flag equivalent to the .NOTABS special macro and is further described below.

[...]

CONTROL MACROS

[...]

.NOTABS
When set to "yes" enables the use of spaces as well as <tabs> to begin recipe lines. By default a non-group recipe is terminated by a line without any leading white-space or by a line not beggining with a <tab> character. Enabling this mode modifies the first condition of the above termination rule to terminate a non-group recipe with a line that contains only white-space. This mode does not effect the parsing of group recipes bracketed by [].

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: dmake and bash on Win?
by LanX (Saint) on Jan 20, 2021 at 23:30 UTC
    I'm trying to play with the examples given in https://makefiletutorial.com/#default-shell

    But I'm on Windows and have dmake via ActiveState's Perl installed, which is trying to use batch as shell-language.

    Do you happen to know how I can tell dmake to use it's "bash" emulation?

    (I suppose strongly it comes with ActiveState too)

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

    update

    I was able to work around that by using git-bash ... But I'm still curios what the canonical approach may be.

      But I'm still curios what the canonical approach may be

      The win32/makefile.mk (written for dmake) in the perl source contains:
      # # set this to point to cmd.exe (only needed if you use some # alternate shell that doesn't grok cmd.exe style commands) # #SHELL *= g:\winnt\system32\cmd.exe
      I guess therefore that, in your makefile, you might want something like:
      SHELL *= C:\path\to\your_shell.exe
      Cheers,
      Rob
      SHELL
          This macro defines the full path to the executable image to be used as the shell when processing single line recipes. This macro must be defined if recipes requiring the shell for execution are to be used. It is assigned a default value in the startup makefile. Under UNIX this value is /bin/sh. 
      

      Who knows if it is honoured when set as an "env" var.

        Thanks ... I know this. :)

        The question is which executable to set?

        pryrt's example contains shell code and he said it works on Win.

        update

        > Who knows if it is honoured when set as an "env" var.

        yes the ENV is honored, running dmake inside git-bash works.

        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://11127172]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-24 02:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found