Subject: Proposal EXCLUDE_SUBDIRS
To: Frederick Bruckman <>
From: Frederick Bruckman <>
List: tech-misc
Date: 08/23/2000 23:41:39
As I got no response to my last post, I've cleaned this up a little,
and included directions. The idea is to arbitrarily exclude
directories on the command line or in /etc/mk.conf, like so:

.ifndef DESTDIR
EXCLUDE_SUBDIRS=	gnu/libexec gnu/usr.bin/sendmail \
.endif # DESTDIR

The 'DESTDIR' thing is in case you ever wanted to do a "make release".
You can't depend on "make(release)" because of all the recursive makes.

I'm ready to commit this, if there are no objections.


Index: bsd.README
RCS file: /cvsroot/sharesrc/share/mk/bsd.README,v
retrieving revision
diff -c -r1.63.4.1 bsd.README
*** bsd.README	2000/06/24 06:59:38
--- bsd.README	2000/08/24 04:36:31
*** 75,80 ****
--- 75,88 ----
  UNPRIVILEGED	If defined, don't set the owner/group/mode when installing
  		files or directories.  This allows a non-root "make install".
+ EXCLUDE_SUBDIRS	This can be set to a list of directories (or subdirectories)
+ 		to be arbitrarily excluded from the build. Directories are
+ 		specified relative to the top level, to any arbitrary depth,
+ 		such as, for example ``gnu/usr.sbin/sendmail gnu/libexec''.
+ 		Note that this isn't guaranteed to work in the general case,
+ 		as you could easily exclude a directory which builds targets
+ 		that are needed by some other directory.
  MKCATPAGES	If "no", don't build or install the catman pages.
  MKDOC		If "no", don't build or install the documentation.
RCS file: /cvsroot/sharesrc/share/mk/,v
retrieving revision 1.38
diff -c -r1.38
***	2000/06/06 08:54:06	1.38
---	2000/08/24 04:36:31
*** 10,15 ****
--- 10,24 ----
  .MAIN:		all
+ .if defined(EXCLUDE_SUBDIRS)
+ .endif
+ .endfor
+ .endif # defined(EXCLUDE_SUBDIRS)
  .for dir in ${SUBDIR}
  .if exists(${dir}.${MACHINE})