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

Re: exported shell variables and scope



On Wed, 25 Jul 2001, Mike Markley wrote:

> Make executes each line in its own shell, so the parentheses are needed to
> make the "source" happen within the same shell as the call to the mk-pgm
> script. In the first case, the setup.sh is being sourced, then that shell's
> exited, then a new shell started for the cd and mk-pgm. See the difference
> now? :)

Not really ;-)

If I explicity place the variable declaration (without export!) before any
target in the makefile, this variable is visible to other commands in the
makefile. Why does "sourcing" those declarations change their scope, or is
it their placement within a target?

I've been at the point of being able to make this work for several
postings now, but I still don't understand well enough to see the big
picture. It seems I get into this confusion whenever I try to port shell
logic to makefile logic...

Thanks for all the help guys,

Dwarf
--
_-_-_-_-_-   Author of "Dwarf's Guide to Debian GNU/Linux"  _-_-_-_-_-_-
_-                                                                    _-
_- aka   Dale Scheetz                   Phone:   1 (850) 656-9769     _-
_-       Flexible Software              11000 McCrackin Road          _-
_-       e-mail:  dwarf@polaris.net     Tallahassee, FL  32308        _-
_-                                                                    _-
_-_-_-_-_-  Released under the GNU Free Documentation License   _-_-_-_-
              available at: http://www.polaris.net/~dwarf/



Reply to: