Subject: Re: make includes optimization
To: None <tech-install@netbsd.org>
From: None <erh@nimenees.com>
List: tech-install
Date: 02/13/2000 02:46:38
(redirected from developers@)
On Sun, Feb 13, 2000 at 02:41:26AM -0600, erh@nimenees.com wrote:
> 	Doing a "make includes" currently walks through all the
> directories in the source tree in order to do a "make includes"
> in each one.  Most of these don't ever need to install any
> header files so it ends up doing a lot of wasted work.
> 	idea: Change the top level Makefile to only descend into
> those directories that need "make includes".  I also have some scripts
> that runs through all the makefiles looking for "INCS" lines and 
> spits out a tree showing what needs "make includes".  This cuts down
> on build time quite a bit.
> 	Objections?  Improvents?  Where should I put the scripts?
> 
> eric
> 
> Rough script at:
> http://www.nimenees.com/netbsd/tools/find_incs.sh
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/basesrc/Makefile,v
> retrieving revision 1.105
> diff -u -r1.105 Makefile
> --- Makefile	2000/02/01 01:22:05	1.105
> +++ Makefile	2000/02/13 08:19:39
> @@ -46,11 +46,15 @@
>  
>  # NOTE THAT etc *DOES NOT* BELONG IN THE LIST BELOW
>  
> +.if !make(includes)
>  SUBDIR+= lib include bin libexec sbin usr.bin usr.sbin share sys
> +.else
> +SUBDIR+= lib include                  usr.bin                sys
> +.endif
>  
>  includes-lib: includes-include includes-sys
>  
> -.if exists(games)
> +.if exists(games) && !make(includes)
>  SUBDIR+= games
>  .endif
>  
> @@ -59,7 +63,7 @@
>  includes-gnu: includes-include includes-sys
>  
>  .if exists(regress)
> -.ifmake !(install)
> +.if !make(install) && !make(includes)
>  SUBDIR+= regress
>  .endif
> 
>  
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/basesrc/usr.bin/Makefile,v
> retrieving revision 1.107
> diff -u -r1.107 Makefile
> --- Makefile	1999/09/02 20:48:27	1.107
> +++ Makefile	2000/02/13 08:32:08
> @@ -4,14 +4,17 @@
>  SRCTOP=	..
>  .include <bsd.crypto.mk>
>  
> -SUBDIR=	apply apropos asa at audio banner basename biff \
> +SUBDIR=	lex
> +.ifmake !(includes)
> +SUBDIR+= \
> +	apply apropos asa at audio banner basename biff \
>  	bzip2 bzip2recover cal calendar cap_mkdb cdplay checknr chflags \
>  	chpass cksum cmp col colcrt colrm column comm compress \
>  	crontab crunch ctags cut dirname du eject elf2aout elf2ecoff env \
>  	error expand false fdformat fgen file find finger fmt fold fpr \
>  	from fsplit fstat ftp gencat getconf getopt gprof head hesinfo \
>  	hexdump id indent innetgr ipcrm ipcs join jot kdump ktrace ktruss \
> -	lam last lastcomm ldd leave less lex locate lock \
> +	lam last lastcomm ldd leave less locate lock \
>  	logger login logname look lorder m4 machine mail \
>  	make man menuc mesg midiplay mixerctl mkdep mkfifo mkstr mktemp \
>  	modstat msgc msgs netgroup netstat newsyslog nfsstat nice nl nohup \
> @@ -26,6 +29,7 @@
>  	wall wc what whatis whereis which who whois window \
>  	write xargs xinstall xlint xstr yacc yes ypcat \
>  	ypmatch ypwhich
> +.endif
>  
>  .if defined(CRYPTOPATH)
>  .sinclude "${CRYPTOPATH}/usr.bin/Makefile.frag"