From owner-freebsd-audit Sun Feb 11 18:45: 1 2001 Delivered-To: freebsd-audit@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 77E5937B401; Sun, 11 Feb 2001 18:44:56 -0800 (PST) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id NAA27393; Mon, 12 Feb 2001 13:44:47 +1100 Date: Mon, 12 Feb 2001 13:44:22 +1100 (EST) From: Bruce Evans X-Sender: bde@besplex.bde.org To: Warner Losh Cc: audit@freebsd.org, peter@freebsd.org, bde@freebsd.org Subject: Re: kmod.mk patches to fix excessive recompiling In-Reply-To: <200102111630.f1BGUrW23037@harmony.village.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Sun, 11 Feb 2001, Warner Losh wrote: > For a long time I've noticed that too many things recompile in the > modules when I rebuild after a cvs update. I've tracked the problem > down now. > > kmod.mk puts @ and machine as dependencies for all the sources. This > is done to ensure that the link exists, but for no other reasons. > However, when the link does exist, the directory mod time comes into > consideration (that directory is the target of the symlink). So, > whenever $S or $S/$MACHINE/include changes, all files are rebuilt inn > the modules tree. My laptop is only a 300MHz Pentium, so this can > take longer than my attention span. Interesting bug (not just because I wrote it :-). I usually use cp instead of ln -s in Makefiles so that I don't have to think about symlink misbehaviour, but this doesn't work for directories. > Index: kmod.mk > =================================================================== > RCS file: /home/imp/FreeBSD/CVS/src/sys/conf/kmod.mk,v > retrieving revision 1.90 > diff -u -r1.90 kmod.mk > --- kmod.mk 2001/01/28 21:24:05 1.90 > +++ kmod.mk 2001/02/11 16:25:20 > @@ -158,7 +158,14 @@ > .MAIN: all > all: objwarn ${PROG} all-man _SUBDIR > > -beforedepend ${OBJS}: ${_ILINKS} > +beforedepend ${OBJS}: > +.if !exists(@) > +beforedepend ${OBJS}: @ > +.endif > +.if !exists(machine) > +beforedepend ${OBJS}: machine > +.endif This should loop over ${_ILINKS}. > + Extra blank line. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message