help-make
[Top][All Lists]
Advanced

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

AW: Exported vs command line variables


From: Warlich, Christof
Subject: AW: Exported vs command line variables
Date: Tue, 20 Sep 2016 05:59:42 +0000

> 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:address@hidden Im Auftrag von Rakesh Sharma
Gesendet: Dienstag, 20. September 2016 06:35
An: Pietro; address@hidden
Betreff: Re: Exported vs command line variables

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


________________________________
From: Help-make <address@hidden> on behalf of Pietro <address@hidden>
Sent: Monday, September 19, 2016 9:32 AM
To: address@hidden
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
address@hidden
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
address@hidden
https://lists.gnu.org/mailman/listinfo/help-make



reply via email to

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