Re: make question (environment variable)

Henrik Carlqvist <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization SunSITE.dk - Supporting Open source
Message-ID <[email protected]>
"James" <[email protected]> wrote:
> VAR=abc
> all:
>       echo $(VAR)
> 
> In unix/bash, to override the variable defined in the makefile,
> make VAR=123
> works.
> 
> However
> export VAR=123; make
> or
> VAR=123 make
> does not seem to work.
> 
> Is there a way to override using export variable method?

You can allow environment variables to override an assignment by using the
following construction:

VAR ?= abc

regards Henrik
-- 
The address in the header is only to prevent spam. My real address is:
hc1(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.