AW: AW: AW: Exported vs command line variables

2016-09-20 Thread Warlich, Christof
> Is there a Make bug report where I could try to raise a bug ?

See http://lmgtfy.com/?q=gnu+make+bug+reports :-)

___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


Re: AW: AW: Exported vs command line variables

2016-09-20 Thread Pietro
"Warlich, Christof"  writes:

>> > I'm not sure though if this is intended behavior or just a bug
>
>> Well, actually I am using version 4.1 and I do see the difference, are
>> you sure it is not working as intended ?
>
> Well, as I said above, I'm definitely not sure. I would most likely consider 
> it being a bug.
> Nevertheless, it's a rather contrived example, so I would not bother too much 
> ... 
Your it is, but mine isn't and it is common to cross-compile stuff givin
flags as command line through *FLAGS implicit variables.

Is there a Make bug report where I could try to raise a bug ? If it
isn't it would be rejected :-)

P.


___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


Re: Exported vs command line variables

2016-09-20 Thread Brian Vandenberg
This makefile example should help clear things up:

$ cat makefile
SHELL := bash
.RECIPEPREFIX := >
blah1 := test1
blah2 := test2
export blah2
# blah2 & blah3 should have identical results
export blah3 := test3

default:
>@$(foreach x,blah1 blah2 blah3 blah4 blah5,echo "${x}: (origin = $(origin
${x}), flavor = $(flavor ${x}), make value = ${${x}}, shell value:
$${${x}:-not set})";)

$ make --version
GNU Make 4.1
(...)

$ blah5=test5 make -f makefile blah4=test4
blah1: (origin = file, flavor = simple, make value = test1, shell value:
not set)
blah2: (origin = file, flavor = simple, make value = test2, shell value:
test2)
blah3: (origin = file, flavor = simple, make value = test3, shell value:
test3)
blah4: (origin = command line, flavor = recursive, make value = test4,
shell value: test4)
blah5: (origin = environment, flavor = recursive, make value = test5, shell
value: test5)

This is identical to:

$ export blah5=test5
$ make -f makefile blah4=test4
blah1: (origin = file, flavor = simple, make value = test1, shell value:
not set)
blah2: (origin = file, flavor = simple, make value = test2, shell value:
test2)
blah3: (origin = file, flavor = simple, make value = test3, shell value:
test3)
blah4: (origin = command line, flavor = recursive, make value = test4,
shell value: test4)
blah5: (origin = environment, flavor = recursive, make value = test5, shell
value: test5)

I was a little surprised to discover that variables passed on the
command-line to make get marked for export.

-brian
___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


Re: AW: Exported vs command line variables

2016-09-20 Thread Pietro
"Warlich, Christof"  writes:

>> There is no difference between the two. They both declare environment 
>> variables for make.
>
> That's not entirely true, at least not for (admittedly rather ancient) GNU 
> Make V3.81.
> E.g., consider this Makefile:
>
> var := $(shell echo "echo hi" >say_hi.sh; chmod +x say_hi.sh; say_hi.sh)
> all: ; @echo $(var)
>
> Calling make with the PATH environment variable either way yiedls:
>
> $ make PATH=$PATH:.
> /bin/sh: 1: say_hi.sh: not found
>
> $ PATH=$PATH:. make
> hi
>
> I'm not sure though if this is intended behavior or just a bug and if
> a more recent version of GNU Make does the same. But considering that
> GNU Make V3.81 is the standard in e.g. Ubuntu LTS 14.04, it may still
> matter.
>
> Cheers,
>
> Chris
>

Well, actually I am using version 4.1 and I do see the difference, are
you sure it is not working as intended ? I can't find anything on the
manual but I am quite curious.



___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


AW: AW: Exported vs command line variables

2016-09-20 Thread Warlich, Christof
> > I'm not sure though if this is intended behavior or just a bug

> Well, actually I am using version 4.1 and I do see the difference, are
> you sure it is not working as intended ?

Well, as I said above, I'm definitely not sure. I would most likely consider it 
being a bug.
Nevertheless, it's a rather contrived example, so I would not bother too much 
... 

___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


AW: Exported vs command line variables

2016-09-19 Thread Warlich, Christof
> There is no difference between the two. They both declare environment 
> variables for make.

That's not entirely true, at least not for (admittedly rather ancient) GNU Make 
V3.81.
E.g., consider this Makefile:

var := $(shell echo "echo hi" >say_hi.sh; chmod +x say_hi.sh; say_hi.sh)
all: ; @echo $(var)

Calling make with the PATH environment variable either way yiedls:

$ make PATH=$PATH:.
/bin/sh: 1: say_hi.sh: not found

$ PATH=$PATH:. make
hi

I'm not sure though if this is intended behavior or just a bug and if a more 
recent version of GNU Make does the same. But considering that GNU Make V3.81 
is the standard in e.g. Ubuntu LTS 14.04, it may still matter.

Cheers,

Chris

-Ursprüngliche Nachricht-
Von: Help-make [mailto:help-make-bounces+christof.warlich=siemens@gnu.org] 
Im Auftrag von Rakesh Sharma
Gesendet: Dienstag, 20. September 2016 06:35
An: Pietro; help-make@gnu.org
Betreff: Re: Exported vs command line variables

There is no difference between the two. They both declare environment variables 
for make.



From: Help-make  on behalf of 
Pietro 
Sent: Monday, September 19, 2016 9:32 AM
To: help-make@gnu.org
Subject: Exported vs command line variables

Hi,

I have noticed that there is a difference between the two scenarios
listed below:

i) make  CC=arm-linux-gnueabihf-gcc CPPFLAGS=[..]

ii) export CPPFLAGS=[..] [RET]
make CC=arm-linux-gnueabihf-gcc


I have read over internet that the latter is used when appending
instead of replacing/setting the variable's value.

What is exactly the difference ? Is there a page in the Make manual
explaining that ?


Thanks a lot,
P.


___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make
Help-make -- Users list for the GNU implementation of 
make<https://lists.gnu.org/mailman/listinfo/help-make>
lists.gnu.org
Help-make -- Users list for the GNU implementation of make About Help-make



___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make

___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


Re: Exported vs command line variables

2016-09-19 Thread Rakesh Sharma
There is no difference between the two. They both declare environment variables 
for make.



From: Help-make  on behalf of 
Pietro 
Sent: Monday, September 19, 2016 9:32 AM
To: help-make@gnu.org
Subject: Exported vs command line variables

Hi,

I have noticed that there is a difference between the two scenarios
listed below:

i) make  CC=arm-linux-gnueabihf-gcc CPPFLAGS=[..]

ii) export CPPFLAGS=[..] [RET]
make CC=arm-linux-gnueabihf-gcc


I have read over internet that the latter is used when appending
instead of replacing/setting the variable's value.

What is exactly the difference ? Is there a page in the Make manual
explaining that ?


Thanks a lot,
P.


___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make
Help-make -- Users list for the GNU implementation of 
make<https://lists.gnu.org/mailman/listinfo/help-make>
lists.gnu.org
Help-make -- Users list for the GNU implementation of make About Help-make



___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make


Exported vs command line variables

2016-09-19 Thread Pietro
Hi,

I have noticed that there is a difference between the two scenarios
listed below:

i) make  CC=arm-linux-gnueabihf-gcc CPPFLAGS=[..]

ii) export CPPFLAGS=[..] [RET]
make CC=arm-linux-gnueabihf-gcc


I have read over internet that the latter is used when appending
instead of replacing/setting the variable's value.

What is exactly the difference ? Is there a page in the Make manual
explaining that ?


Thanks a lot,
P.


___
Help-make mailing list
Help-make@gnu.org
https://lists.gnu.org/mailman/listinfo/help-make