NetBSD-Users archive

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

Re: Help with BSD make



On Sat, Jul 14, 2012 at 06:39:42PM +0200, Petar Bogdanovic wrote:
> 
> That's not really the issue here.  Besides, nbmake ``executes all
> commands for a given target using a single shell invocation'' except
> when -B was specified.  See make(1), COMPATIBILITY.
> 
> In the example above (cd /foo) make fails to execve a program called cd,
> and does not execute any shell prior to that.  It also fails because of
> the same reason when given two args (cd /foo /bar) but passes the lines
> correctly to sh if one of the arguments contains a shell metacharacter
> (like $ or #).

I didn't know about this "speciality". But then the cause is in 
compat.c:

/*  
 * The following array is used to make a fast determination of which
 * characters are interpreted specially by the shell.  If a command 
 * contains any of these characters, it is executed by the shell, not
 * directly by us.
 */ 

From a very cursory look (so take it with a grain of salt), make(1)
does not call the shell but tries to exec itself the commands if
there is not these characters.

Am I the only one to consider that with the .obj dance, the expansions
and all these "singularities", this version of make is at the edge
of being unpredictable?

(BTW, tired of trying to be sure of what will happen if my software was
built elsewhere, I finally designed R.I.S.K. to have a Makefile
skeleton, let ed(1), sed(1) and some sh(1) scripts build the full
version and use the minimal but core functionnalities of make(1) as
required by POSIX.)
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                      http://www.kergis.com/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index