On Sat, 2009-02-28 at 20:29 +0100, Sam Ravnborg wrote:
> On Sun, Mar 01, 2009 at 12:06:54AM +0530, kalyan wrote:
> > Hi John,
> > I actually tried out these examples:
> >
> > case 1:
> > test:
> > @export QA_STEP=start;touch ${QA_STEP}
> > This case actually gave the error of "touch: file arguments missing". Note
> > that using curly or normal braces gave the same error.
>
> The intention here is to do it in the shell.
> So the obvious fix is to escape the dollar sign like this:
>
> test:
> @export QA_STEP=start;touch $${QA_STEP}
This is correct, but I just wanted to make one last point: a pet peeve
of mine.
Note that this format, "export var=value" is not that portable.
Remember make runs /bin/sh, and there are a number of /bin/sh instances
out there which do not support this syntax.
In this example you actually don't even need to export QA_STEP, since
only the shell is expanding it. But, if you do really need to export it
then please do it portably:
test:
@QA_STEP=start; export QA_STEP; <do-something>
--
-------------------------------------------------------------------------------
Paul D. Smith <[email protected]> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.us
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make