delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/09/04/01:52:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3D759296.D12DDC02@csksoftware.com>
Date: Wed, 04 Sep 2002 06:56:54 +0200
From: "Johan Bezem" <jbezem AT csksoftware DOT com>
Reply-To: CygWin Mailing List <cygwin AT cygwin DOT com>
Organization: CSK Software AG
X-Accept-Language: en,de,nl,el,fr,af,es,it
MIME-Version: 1.0
To: Wendy Vanhonacker <wvanhon AT us DOT ibm DOT com>
Cc: cygwin AT cygwin DOT com
Subject: Re: make and shell calls
References: <OFE862F8EA DOT BC298464-ON87256C29 DOT 0074E3E9 AT boulder DOT ibm DOT com>
X-Virus-Scanned: by AMaViS snapshot-20010407

OK, I tried the follwing:

Makefile-dirs reads:
export SB_ROOT=/cygdrive/c/sbroot
$(SB_ROOT)/bin :
        mkdir $(SB_ROOT)/bin

When I call make with the following command line:
  make -f Makefile-dirs /cygdrive/c/sbroot/bin

it works. I tried:
1. From the command line directly (CMD.EXE on W2K SR2)
2. Start CMD.EXE, call sh, and execute in sh.
3. Start CMD.EXE, call bash, and execute in bash.
All with the same (positive) result.

You have to be careful when escaping, since all three environments (sh, bash
and make) perform escaping in a different way. When using MAKE_MODE=unix,
the colon in a DOS-formatted path will confuse make, so you'd have to use
the 'cygdrive' notation anyway, and then fowrard slashes present no problem.
When backslashes are necessary, be aware that both the shell (command line!)
and make will perform escaping, so you'd probably need _four_ backslashes
for the command line, and two in your makefile (not tested, though, since
the colon-notation will not work anyhow...).
Also, be aware that 'sh' under CygWin effectively means 'ash', which is not
quite the same.

Regards,

Johan Bezem
CSK Software AG

Wendy Vanhonacker wrote:
> 
> Hi
> First, Thanks for your help!
> Here are some more details.
> I have make version 3.79.-7 and cygwin  1.3.12-2.
> I'm running the makefiles from MSDOS. So I added MAKE_MODE=unix and the
> cygwin/bin directory to the path.
> 
> When I run my program on cygwin it works. For all cases:
> export SB_ROOT=d:/sbroot
> $(SB_ROOT)/bin :
>       mkdir $(SB_ROOT)/bin
> 
> OR
> 
> export SB_ROOT=/cygdrive/d/sbroot
> $(SB_ROOT)/bin :
>       mkdir $(SB_ROOT)/bin
> 
> OR
> export SB_ROOT=d:\\sbroot
> $(SB_ROOT)\\bin :
>       mkdir $(SB_ROOT)\\bin
> 
> But the problems comes when I use MSDOS. If I type 'sh' in DOS, and then
> mkdir d:\sbroot\bin, it doesn't work, it says the usual:
> $ mkdir d:\sbroot\bin
> Extended Error 183
>    1753 [main] sh 922 proc_subproc: Couldn't duplicate my handle<0x38> for
> pid 1634226260, Win32 error 6
> 
> With mkdir d:/sbroot/bin, I get:
> $ mkdir d:/sbroot/bin
> Invalid switch - /sbroot
>    2311 [main] sh 967 proc_subproc: Couldn't duplicate my handle<0x38> for
> pid 1634226260, Win32 error 6
> 
> I don't think it's a cygwin interpretation problem...I tried all the
> possible cases.. how many // or \\... or cygdrive/d/...
> When I type sh in DOS I get the shell installed from cygwin (since it's
> shared by the environment setup that I have), but it doesn't understand the
> same commands!!!!
> I think the invalid switch problem is because I use this shell on DOS and
> it doesn't like it...
> Can you try that on your windows machine?try 'sh' on MSDOS and then mkdir
> ...
> I'm pretty much sure that my shell line is interpreted by sh, so it
> shouldn't be a make interpretation (like the colon problem as target)
> 
> The 'coudn't duplicate...' error comes whenever I put a unix command line
> like mkidr or rmdir or chmod... as a shell line . I don't think it is
> supposed to do this either.. It has nothing to do with backslashes or
> anything. If I type 'mkdir temp' it does so too..!!
> Where does the shell from Cygwin installation come from? Is it Bourne or
> Korn shell? What package installs sh.exe?
> 
> thanks
> 
> --
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> Bug reporting:         http://cygwin.com/bugs.html
> Documentation:         http://cygwin.com/docs.html
> FAQ:                   http://cygwin.com/faq/


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019