Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 12 Feb 2001 13:44:22 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Warner Losh <imp@harmony.village.org>
Cc:        audit@freebsd.org, peter@freebsd.org, bde@freebsd.org
Subject:   Re: kmod.mk patches to fix excessive recompiling
Message-ID:  <Pine.BSF.4.21.0102121310120.1520-100000@besplex.bde.org>
In-Reply-To: <200102111630.f1BGUrW23037@harmony.village.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0102121310120.1520-100000>