From owner-freebsd-hackers Wed Nov 20 23:38:24 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1F4F437B401 for ; Wed, 20 Nov 2002 23:38:23 -0800 (PST) Received: from natto.numachi.com (natto.numachi.com [198.175.254.216]) by mx1.FreeBSD.org (Postfix) with SMTP id EE8E343E6E for ; Wed, 20 Nov 2002 23:38:20 -0800 (PST) (envelope-from reichert@numachi.com) Received: (qmail 94793 invoked by uid 1001); 21 Nov 2002 07:38:19 -0000 Date: Thu, 21 Nov 2002 02:38:19 -0500 From: Brian Reichert To: Dan Nelson Cc: Brian Reichert , hackers@FreeBSD.ORG Subject: Re: seeking clarification of makefile rules 'safe' with -j Message-ID: <20021121023819.A94248@numachi.com> References: <20021121000216.H82833@numachi.com> <20021121055345.GA65788@dan.emsphone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20021121055345.GA65788@dan.emsphone.com>; from dnelson@allantgroup.com on Wed, Nov 20, 2002 at 11:53:45PM -0600 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 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