Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2002 02:38:19 -0500
From:      Brian Reichert <reichert@numachi.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        Brian Reichert <reichert@numachi.com>, hackers@FreeBSD.ORG
Subject:   Re: seeking clarification of makefile rules 'safe' with -j
Message-ID:  <20021121023819.A94248@numachi.com>
In-Reply-To: <20021121055345.GA65788@dan.emsphone.com>; from dnelson@allantgroup.com on Wed, Nov 20, 2002 at 11:53:45PM -0600
References:  <20021121000216.H82833@numachi.com> <20021121055345.GA65788@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Nov 20, 2002 at 11:53:45PM -0600, Dan Nelson wrote:
> .y.out uses a constant filename (y.tab.c) as an intermediate file.  If
> make -j decided to compile two .y files in the same directory at the
> same time, one's going to get overwritten.  .l.out avoids this by using
> ${.PREFIX}, which expands to the filename of the source file minus path
> and extension.  .y.out could be made safe by making the first line 
> 
>    ${YACC} ${YFLAGS} -o ${.PREFIX}.y.tmp.c ${.IMPSRC}
> 
> and replacing y.tab.c. with ${.PREFIX}.y.tmp.c .  For good measure,
> .l.out should probably be using ${.PREFIX}.l.tmp.c, just so you can
> tell which rule generated a particular tempfile.

Ah, that does paint it succinctly.  If your suggestion is sound,
should it be perhaps submitted as a PR to make 'make' even safer
by default?

> -- 
> 	Dan Nelson
> 	dnelson@allantgroup.com

-- 
Brian 'you Bastard' Reichert		<reichert@numachi.com>
37 Crystal Ave. #303			Daytime number: (603) 434-6842
Derry NH 03038-1713 USA			Intel architecture: the left-hand path

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021121023819.A94248>