make-w32
[Top][All Lists]
Advanced

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

RE: [Mingw-users] bug in mingw32-make


From: Heiko Gerdau
Subject: RE: [Mingw-users] bug in mingw32-make
Date: Mon, 16 Dec 2002 16:16:46 +0100

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf Of 
> Earnie Boyd
>
> > There is a problem with the mingw-port of gnu make when 
> exporting the
> > PATH-variable using a windows dos shell. The Makefile below 
> demonstrates
> > the bug.
> > If you call it with "make" the mycc.bat is not found.
> > The workaround: If you call it with "make SET_Path=1" 
> (using the path
> > variable with lower case letters) it works.
> > 
> 
> This is a Windows feature not a make bug.  The environment 
> variable you 
> have in Windows is Path not PATH.

I haven't seen an official statement about upper or lower case. If you
type "SET" in a command shell you get the version of "PATH" you've
defined in the system environment settings. In either case the variable
works on windows (even using "path" ot "paTh"). Older command line
processors mapped everything to upper case (try using command.com). In
most documentations in msdn it's "PATH". For instance: 

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/
html/_asug_Environment.2d.Variable_Macros.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tools/r
c_2hmb.asp

Whatever the official spelling is, I hope the modified makefile below
demonstrates that the problem is not a windows feature. Instead make
just behaves wrong on windows cause the only way the example below
succeeds is to set both PATH and Path.
Please correct me if I miss something.

Makefile:
#----------------------------------------------------------
#
# mingw-make fails when called with either of
#   make             (make.exe fails)
#   make USE_Path=1  (cmd.exe fails)
#   make USE_PATH=1  (make.exe fails)
# and succeeds when called with
#   make USE_Path=1 USE_PATH=1
#

ifneq ($(EXPORTED),1)
EXPORTED = 1
ifeq ($(USE_PATH),1)
PATH := $(shell cd)\localdir;$(PATH)
endif
ifeq ($(USE_Path),1)
Path := $(shell cd)\localdir;$(Path)
endif
endif

all: mycc
        @echo PATH=$(PATH)
        @echo Path=$(Path)
        mycc.bat

localdir:
        @if not exist $@ md $@

mycc: localdir
        @echo @echo *** successfully called mycc *** >localdir\mycc.bat

#--------------------------------------------------------------

Greetings
Heiko





reply via email to

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