On Wed, 12 Dec 2001, Simon Cozens wrote:

> On Wed, Dec 12, 2001 at 10:06:16AM -0500, Dan Sugalski wrote:
> > I'm not sure it will, though I'm hopeful.
> > In vain, apparently. Better, but not better enough.
> 
> I *think* I've fixed the fix. The 
>     cd foo
>     make 
> solution has one big problem: Make does its work by forking and exec'ing
> processes. Which directory do think you're in when the process forked to
> run "cd" returns? :)
> 
> My solution assumes (for now) that "make -C" works, and that make sets
> $(MAKE). Both of these assumptions are probably broken somewhere.

make -C doesn't work in Solaris.  I suspect it's a GNUism.

Most 'makes' do set $(MAKE), but not all of them.  I seem to recall that
some of the SystemV-derived ones don't.  (Such systems are very poorly
represented on p5p, let alone p6i, so reliable information may be very
hard to come by.)

However, feel free to use the relevant code from perl5.  (I wrote it,
so don't worry about the License.)  In perl5's Makefile.SH, there are 
the lines:

    # This is set to  MAKE=$make if your $make command doesn't
    # do it for you.
    $make_set_make

For most of us, $Config{make_set_make}='#', just a plain comment.

One idiom which might work is

        cd foo && $(MAKE)

Since lines in makefiles are handed off to the native shell, this will
be dependent upon the user's native shell.  I don't know any details,
but I gather the various shells in Win95, Win98, WinNT, and WinXP are
not necessarily identical.  I *think* the above idiom works in NT, but
not Win98.  I'm hopeful it will work in XP.
(Of course, the user may well have installed a different command
shell, in which case who knows what will happen.)

If the user is using dmake, but is stuck with Win95(?)'s command.com,
then he or she can still use perl5's win32/genmk95.pl.  Here are the
comments from it:

# genmk95.pl - uses miniperl to generate a makefile that command.com will
#              understand given one that cmd.exe will understand

# Author: Benjamin K. Stuhl
# Date: 10-16-1999

# how it works:
#    dmake supports an alternative form for its recipes, called "group
#    recipes", in which all elements of a recipe are run with only one shell.
#    This program converts the standard dmake makefile.mk to one using group
#    recipes. This is done so that lines using && or || (which command.com
#    doesn't understand) may be split into two lines that will still be run
#    with one shell.

We would need permission from the author to include the script itself in
parrot.


Short summary:

Use

        cd foo && $(MAKE)

-- 
    Andy Dougherty              [EMAIL PROTECTED]
    Dept. of Physics
    Lafayette College, Easton PA 18042


Reply via email to