dw dw wrote:
> So in my makefile can i do something like this?:
>
> --snip
> GAMESOURCE=eval $ENV_VAR_GAME
> --snip
Well no, not really.
1) That isn't correct Makefile syntax for variables; you need
$(ENV_VAR_NAME) or ${ENV_VAR_NAME} in the Makefile.
2) You are mixing shell variable expansions and Makefile macro
expansions, in the Makefile context; since you have part of
the expansion which is itself a shell variable name, you are
creating a scenario which *might* confuse make; (it certainly
*would* confuse *me*, even if make did handle it correctly,
and I like to be able to keep track of what goes on in
my Makefiles).
3) If you really *must* do it, (and I wouldn't; see below), you
need
GAMESOURCE = eval $$ENV_VAR_GAME
in the Makefile.
Here's how I would do it:
1) Expunge *both* ENV_VAR and ENV_VAR_GAME *utterly* from the
Windows master environment, (i.e. where you set them with
Windows Control Panel).
2) In your Makefile, include:
GAMESOURCE=/c/Programs/Work/Games/Source
(don't bother trying to resolve the shell variables here).
3) Invoke make as normal, to use the default GAMESOURCE you set
at (2).
4) Invoke, say
make GAMESOURCE=/c/Programs/Fun/Games/Source
to override the default, and use /c/Programs/Fun/Games/Source
instead.
HTH,
Keith.
|