help-make
[Top][All Lists]
Advanced

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

Re: export not working...


From: Yakov Lerner
Subject: Re: export not working...
Date: Wed, 21 Jan 2004 16:08:25 +0200
User-agent: Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.0.1) Gecko/20020920 Netscape/7.0

Christopher J Bottaro wrote:
i'm trying to do a recursive make, but the variables i export are not being seen by the sub makes.

SUBDIRS = blah...

$(SUBDIRS):
        @if [ $(ARCH) = LINUX ]; then \
                export MYVAR = DEBUG; \
        fi
        cd $@ && $(MAKE)

when the sub make runs, MYVAR is not defined.  what am i doing wrong?

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)

Jacob





reply via email to

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