Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Date: Wed, 14 Jan 2004 16:55:27 -0500
From: Christopher Faylor <cgf-no-personal-reply-please@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: bug in cygwin build of Make
Message-ID: <20040114215527.GB5176@redhat.com>
Mail-Followup-To: cygwin@cygwin.com
References: <400506B3.6000902@ieee.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <400506B3.6000902@ieee.org>
User-Agent: Mutt/1.4.1i
X-IsSubscribed: yes
Reply-To: cygwin@cygwin.com

On Wed, Jan 14, 2004 at 09:06:59AM +0000, Jason Pearce wrote:
>I have discovered a problem in cygwin's Make.
>
>I am calling a sub-make that goes to another directory. That bit works 
>fine, but the Makefiles have a variable set from a shell command. That 
>shell seems to be spawned from the wrong directory. I have created a 
>small example illustrating the problem
>
>dir2/Makefile:
>---------------
>VARIABLE = $(shell echo $$PWD)
>
>target :
>   ${MAKE} -C ../dir1 sources
>   @echo VARIABLE set to ${VARIABLE}

You can't rely on PWD being set correctly.  Use something like
$(shell pwd) instead.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

