make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Caret escaping (was: Re: make'ing make-3.18beta4 undermingw/msys...


From: Markus Mauhart
Subject: Re: Caret escaping (was: Re: make'ing make-3.18beta4 undermingw/msys...
Date: Wed, 4 Jan 2006 21:47:09 +0100

"Paul D. Smith" <address@hidden> wrote ...
>
> %% Alessandro Vesely <address@hidden> writes:
>
>  av> Thus, in case the "slow path" is taken, the LINE command should be 
> replaced with
>  av> SHELL FLAG ESCAPED-LINE, where:
>  av>   SHELL may be either a unixy_shell, cmd.exe or the old command.com,
>  av>   FLAG should be -c for unixy_shell or /C otherwise, and
>  av>   ESCAPED-LINE should be escaped using backslashes for unixy_shell,
>  av>     carets for cmd.exe, or
>  av>     no escape at all for the old command.exe.
>  av> Then there is a batch_mode_shell flag, which is usually set for cmd.exe
>  av> and causes a NOT-SO-ESCAPED-LINE to be written to a temporary batch file.
>  av> Should we revise those specs in order to make a smarter use of cmd.exe?
>
>  av> Althought that patch also allowed -jN to be specified w/o
>  av> unixy_shell, after Paul's clarifications it seems the "-j"-change
>  av> does not depend on escaping.
>
>  av> Typically, smarter escaping might be required if the command is, say,
>
>  av>     egrep ^foo $^ | something
>
>  av> In that case, cmd.exe eats the caret unless it is escaped as ^^foo;
>  av> command.com does not. As a workaround one can escape the command in
>  av> the makefile, which then cannot be ported to windows 98.
>
> It may be that the DOS/Windows port does more with this than the UNIX
> port; I'm pretty sure there's no need to escape anything in UNIX since
> the string is passed directly to the shell with exec().

I just checked it out (VC - built make381beta4 with above patches applied)
and it turns out that ^-escaping breaks my makefiles (not using -j):
make381beta4.exe now creates a batch file which 2nd line starts with ...

    (^"C:/Program Files/msvs71/Common7/Tools/vsvars32.bat^" > nul) && cl

cmd.exe then says:

    '"C:/Program' is not recognized as an internal or external command,
    operable program or batch file.

My intent surely was ...

    ("C:/Program Files/msvs71/Common7/Tools/vsvars32.bat" > nul) && cl

So AFAICS this part of the jobs-patch is wrong:

    >  . use '^' to escape special characters such as \ and " in job.c


Regards,
Markus.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]