bug-make
[Top][All Lists]
Advanced

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

Re: not a bug but some strange behaviour


From: jean-luc malet
Subject: Re: not a bug but some strange behaviour
Date: Tue, 1 Dec 2009 11:44:55 +0100

found!
I was using SHELL = /bin/sh
I shall have used SHELL = sh
and in fact make behave differently if the path is inside the SHELL variable....
info make in section choosing the shell....
however I find this strange and confusing that make behave differently
on dos/windows than on cygwin/unix....
JLM

On Tue, Dec 1, 2009 at 11:05 AM, jean-luc malet <address@hidden> wrote:
> in the bat file you have to do
> call path\to\the\real\make.exe %*
> you might also want to use the -f option of make to have it using the
> right makefile
> JLM
>
> On Mon, Nov 30, 2009 at 11:58 PM, Martin Dorey <address@hidden> wrote:
>>> $make.bat test3
>>
>>> <empty line>
>>
>>
>>
>> Interestingly, I failed to reproduce your problem:
>>
>>
>>
>> $ ./make.bat test3
>>
>>
>>
>> C:\Documents and
>> Settings\martind\playpen\jlm-2009-11-30>C:\cygwin-1.5\bin\make test3
>>
>> printf "${ENV_VAR1}\n"
>>
>> fromtheenv
>>
>> $
>>
>>
>>
>> I tried with Cygwin 1.5 and 1.7.  Here's more information about the 1.5
>> versions:
>>
>>
>>
>> $ uname -a
>>
>> CYGWIN_NT-5.1 vm-martind 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
>>
>> $ bash --version
>>
>> GNU bash, version 3.2.49(22)-release (i686-pc-cygwin)
>>
>> Copyright (C) 2007 Free Software Foundation, Inc.
>>
>> $ make --version
>>
>> GNU Make 3.81
>>
>> Copyright (C) 2006  Free Software Foundation, Inc.
>>
>> This is free software; see the source for copying conditions.
>>
>> There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
>>
>> PARTICULAR PURPOSE.
>>
>>
>>
>> This program built for i686-pc-cygwin
>>
>> $
>>
>>
>>
>> The exact test case I used wasn't quite the same as you gave:
>>
>>
>>
>> $ cat make.bat
>>
>> C:\cygwin-1.5\bin\make %*
>>
>> $ cat Makefile
>>
>>
>>
>> export TEST_FLAG=test
>>
>> SHELL=/bin/bash
>>
>>
>>
>> test :
>>
>>         printf "$${TEST_FLAG}\n"
>>
>>
>>
>> test2 :
>>
>>         printf "${TEST_FLAG}\n"
>>
>>
>>
>> test3 :
>>
>>         printf "$${ENV_VAR1}\n"
>>
>>
>>
>> test4 :
>>
>>         printf "${ENV_VAR1}\n"
>>
>>
>>
>> test5 :
>>
>>         ENV_VAR1=${ENV_VAR1}; /bin/bash somescriptthatdoprintfenv_var1
>>
>>
>>
>>
>>
>> $
>>
>>
>>
>> If I had make.bat run "make", then it ended up invoking itself.  My bat-fu
>> is weak:
>>
>>
>>
>> $ cat make.bat
>>
>> set PATH=C:\cygwin-1.5\bin;%PATH%
>>
>> make %*
>>
>> $
>>
>>
>>
>> -----Original Message-----
>> From: jean-luc malet [mailto:address@hidden
>> Sent: Monday, November 30, 2009 14:27
>> To: Martin Dorey
>> Cc: bug-make
>> Subject: Re: not a bug but some strange behaviour
>>
>>
>>
>> $cat make.bat
>>
>> set PATH=cygwin_Path;oldPath
>>
>> make %*
>>
>>
>>
>> $ cat /tmp/Makefile
>>
>>
>>
>> export TEST_FLAG=test
>>
>> SHELL=/bin/bash
>>
>>
>>
>> test :
>>
>> <tab> printf "$${TEST_FLAG}\n"
>>
>>
>>
>> test2 :
>>
>> <tab> printf "${TEST_FLAG}\n"
>>
>>
>>
>> test3 :
>>
>> <tab> printf "$${ENV_VAR1}\n"
>>
>>
>>
>> test4 :
>>
>> <tab> printf "${ENV_VAR1}\n"
>>
>>
>>
>> test5 :
>>
>> <tab> ENV_VAR1=${ENV_VAR1}; /bin/bash somescriptthatdoprintfenv_var1
>>
>>
>>
>>
>>
>>
>>
>> $ export ENV_VAR1=fromtheenv
>>
>> ----- cygwin env (make is called throught a .bat file) -----
>>
>> $ make.bat test
>>
>> <empty line>
>>
>> $ make.bat test2
>>
>> test
>>
>> $make.bat test3
>>
>> <empty line>
>>
>> $make.bat test4
>>
>> fromtheenv
>>
>> $make.bat test5
>>
>> fromtheenv
>>
>>
>>
>> ------ from an interactive shell, cygwin env ----
>>
>> $make test
>>
>> test
>>
>> $make test2
>>
>> test
>>
>> $make test3
>>
>> fromtheenv
>>
>> $make test4
>>
>> fromtheenv
>>
>> $make test5
>>
>> fromtheenv
>>
>>
>>
>> ------- linux ------
>>
>> always working
>>
>>
>>
>> to make it short : if you call the subshell by setting the env
>>
>> variable on the same line it will ever work
>>
>> if you try to access some env variable in the makefile it always work
>>
>> if you try to use the env variable into one of the command it fails
>>
>> depending on the context.....
>>
>>
>>
>> Best Regards
>>
>> JLM
>>
>>
>>
>> On Mon, Nov 30, 2009 at 8:22 PM, Martin Dorey <address@hidden> wrote:
>>
>>> Can you contrive a simple test case - something that you can post here in
>>> its entirety to help someone reproduce the problem?
>>
>>>
>>
>>> -----Original Message-----
>>
>>> From: address@hidden
>>> [mailto:address@hidden On Behalf Of jean-luc
>>> malet
>>
>>> Sent: Monday, November 30, 2009 10:27
>>
>>> To: bug-make
>>
>>> Subject: not a bug but some strange behaviour
>>
>>>
>>
>>> Hi!
>>
>>> I have a cygwin environment in which I've written a makefile, in this
>>
>>> environment it's working fine
>>
>>> I want to make it available to other dos user, so I've written a bat
>>
>>> file that set the cygwin path and call make,
>>
>>> in the doc env when I do
>>
>>> echo %somevar%
>>
>>> I see the correct result
>>
>>> however in commands launched by make (shell scripts) the ${somevar}
>>
>>> expand to nothing... as if make was stripping the env....
>>
>>> any idea?
>>
>>> thanks
>>
>>> JLM
>>
>>>
>>
>>> --
>>
>>> KISS! (Keep It Simple, Stupid!)
>>
>>> (garde le simple, imbécile!)
>>
>>> "mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
>>
>>> simples et qui marchent, espèce d'imbécile!"
>>
>>> -----------------------------
>>
>>> "Si vous pensez que vous êtes trop petit pour changer quoique ce soit,
>>
>>> essayez donc de dormir avec un moustique dans votre chambre." Betty
>>
>>> Reese
>>
>>> http://www.grainesdechangement.com/citations.htm
>>
>>>
>>
>>>
>>
>>> _______________________________________________
>>
>>> Bug-make mailing list
>>
>>> address@hidden
>>
>>> http://lists.gnu.org/mailman/listinfo/bug-make
>>
>>>
>>
>>
>>
>>
>>
>>
>>
>> --
>>
>> KISS! (Keep It Simple, Stupid!)
>>
>> (garde le simple, imbécile!)
>>
>> "mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
>>
>> simples et qui marchent, espèce d'imbécile!"
>>
>> -----------------------------
>>
>> "Si vous pensez que vous êtes trop petit pour changer quoique ce soit,
>>
>> essayez donc de dormir avec un moustique dans votre chambre." Betty
>>
>> Reese
>>
>> http://www.grainesdechangement.com/citations.htm
>
>
>
> --
> KISS! (Keep It Simple, Stupid!)
> (garde le simple, imbécile!)
> "mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
> simples et qui marchent, espèce d'imbécile!"
> -----------------------------
> "Si vous pensez que vous êtes trop petit pour changer quoique ce soit,
> essayez donc de dormir avec un moustique dans votre chambre." Betty
> Reese
> http://www.grainesdechangement.com/citations.htm
>



-- 
KISS! (Keep It Simple, Stupid!)
(garde le simple, imbécile!)
"mais qu'est-ce que tu m'as pondu comme usine à gaz? fait des choses
simples et qui marchent, espèce d'imbécile!"
-----------------------------
"Si vous pensez que vous êtes trop petit pour changer quoique ce soit,
essayez donc de dormir avec un moustique dans votre chambre." Betty
Reese
http://www.grainesdechangement.com/citations.htm




reply via email to

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