help-make
[Top][All Lists]
Advanced

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

Re: export not working...


From: Noel Yap
Subject: Re: export not working...
Date: Wed, 21 Jan 2004 08:43:25 -0500

Yakov Lerner wrote:
> You need to rewrite it so that export is within same shell command
> as $(MAKE). Then it will work:
> 
> $(SUBDIRS):
>         @if [ $(ARCH) = LINUX ]; then \
>                 export MYVAR=DEBUG; \
>         fi; \
>         cd $@ && $(MAKE)

I think having the if logic performed by make makes the shell output easier to 
read (eg when doing "make -n"):

$(SUBDIRS):
        @$(if $(filter LINUX,$(ARCH)),export MYVAR=DEBUG;) \
        cd $@ && $(MAKE)

Noel
-- 
NOTICE: If received in error, please destroy and notify sender.  Sender does 
not waive confidentiality or privilege, and use is prohibited.




reply via email to

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