On Mon, Jan 11, 2010 at 02:21:13PM -0800, Craig Citro wrote:
> > Having thought about it more, there could be a problem with my original
> > approach. IF someone typed
> >
> > $ export MAKE=/my/favorite/make -j 200
> > $ make
> >
> > then my approach, and your suggestion for sage-env would work.
> >
> 
> You've also got trouble if they do
> 
> $ export MAKE='/my/favorite/path with spaces/make -j 100'
> 
> because that awk command just prints the first space-delimited token.
> The only way I can think of to get around that would be to use a
> regexp to take everything after the last / to find the path, then use
> something like the awk command above to get the command name, and
> append them back together. Is there a more clever way to do it?
> 
> Also, presumably you could even have a situation like this:
> 
> $ export FOO='/my/favorite/path to make/"make with a space"'

That would indeed break the suggested 'preparsing', but actually I don't think
these are issues we should worry about, because make itself cannot handle
spaces in filenames. There are some tricks to partially work around this in
some cases, but it's not pretty. See e.g.,
http://www.makelinux.net/make3/make3-CHP-7-SECT-3.html .
If you set MAKE to something with a space, then any recursively called makes
will break.


Incidentally, the MAKEFLAGS environment variable can also trigger parallel
makes (e.g., export MAKEFLAGS="-j 10")



-Willem Jan
-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to