Start using the fact that SUBDIR.yes is added to SUBDIR

and move from the pattern of:

.if ${MK_FOO} != "no"
SUBDIR+= bar
.endif

to

SUBDIR.${MK_FOO}+= bar

since we know that MK_FOO is always either yes or no and the latter
form is easier to follow and much shorter. Various exception to this
pattern dealt with on an ah-hoc basis.

Discussed on arch@ a while ago.
This commit is contained in:
Warner Losh 2015-10-05 21:41:55 +00:00
parent 94746562ff
commit 3a845236df
2 changed files with 98 additions and 230 deletions

View File

@ -40,21 +40,10 @@ SUBDIR= cat \
test \
uuidgen
.if ${MK_RCMDS} != "no"
SUBDIR+= rcp
.endif
.if ${MK_SENDMAIL} != "no"
SUBDIR+= rmail
.endif
.if ${MK_TCSH} != "no"
SUBDIR+= csh
.endif
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
SUBDIR.${MK_RCMDS}+= rcp
SUBDIR.${MK_SENDMAIL}+= rmail
SUBDIR.${MK_TCSH}+= csh
SUBDIR.${MK_TESTS}+= tests
.include <bsd.arch.inc.mk>

View File

@ -190,230 +190,109 @@ SUBDIR= alias \
# NB: keep these sorted by MK_* knobs
.if ${MK_AT} != "no"
SUBDIR+= at
.endif
.if ${MK_ATM} != "no"
SUBDIR+= atm
.endif
.if ${MK_BLUETOOTH} != "no"
SUBDIR+= bluetooth
.endif
.if ${MK_BSD_CPIO} != "no"
SUBDIR+= cpio
.endif
.if ${MK_CALENDAR} != "no"
SUBDIR+= calendar
.endif
.if ${MK_CLANG} != "no"
SUBDIR+= clang
.endif
.if ${MK_EE} != "no"
SUBDIR+= ee
.endif
.if ${MK_FILE} != "no"
SUBDIR+= file
.endif
.if ${MK_FINGER} != "no"
SUBDIR+= finger
.endif
.if ${MK_FTP} != "no"
SUBDIR+= ftp
.endif
.if ${MK_GAMES} != "no"
SUBDIR+= caesar
SUBDIR+= factor
SUBDIR+= fortune
SUBDIR+= grdc
SUBDIR+= morse
SUBDIR+= number
SUBDIR+= pom
SUBDIR+= primes
SUBDIR+= random
.endif
.if ${MK_GPL_DTC} != "yes"
SUBDIR+= dtc
.endif
.if ${MK_GROFF} != "no"
SUBDIR+= vgrind
.endif
.if ${MK_HESIOD} != "no"
SUBDIR+= hesinfo
.endif
.if ${MK_ICONV} != "no"
SUBDIR+= iconv
SUBDIR+= mkcsmapper
SUBDIR+= mkesdb
.endif
.if ${MK_ISCSI} != "no"
SUBDIR+= iscsictl
.endif
.if ${MK_KDUMP} != "no"
SUBDIR+= kdump
SUBDIR+= truss
.endif
.if ${MK_KERBEROS_SUPPORT} != "no"
SUBDIR+= compile_et
.endif
.if ${MK_LDNS_UTILS} != "no"
SUBDIR+= drill
SUBDIR+= host
.endif
.if ${MK_LOCATE} != "no"
SUBDIR+= locate
.endif
SUBDIR.${MK_AT}+= at
SUBDIR.${MK_ATM}+= atm
SUBDIR.${MK_BLUETOOTH}+= bluetooth
SUBDIR.${MK_BSD_CPIO}+= cpio
SUBDIR.${MK_CALENDAR}+= calendar
SUBDIR.${MK_CLANG}+= clang
SUBDIR.${MK_EE}+= ee
SUBDIR.${MK_FILE}+= file
SUBDIR.${MK_FINGER}+= finger
SUBDIR.${MK_FTP}+= ftp
SUBDIR.${MK_GAMES}+= caesar
SUBDIR.${MK_GAMES}+= factor
SUBDIR.${MK_GAMES}+= fortune
SUBDIR.${MK_GAMES}+= grdc
SUBDIR.${MK_GAMES}+= morse
SUBDIR.${MK_GAMES}+= number
SUBDIR.${MK_GAMES}+= pom
SUBDIR.${MK_GAMES}+= primes
SUBDIR.${MK_GAMES}+= random
SUBDIR.${MK_GPL_DTC}+= dtc
SUBDIR.${MK_GROFF}+= vgrind
SUBDIR.${MK_HESIOD}+= hesinfo
SUBDIR.${MK_ICONV}+= iconv
SUBDIR.${MK_ICONV}+= mkcsmapper
SUBDIR.${MK_ICONV}+= mkesdb
SUBDIR.${MK_ISCSI}+= iscsictl
SUBDIR.${MK_KDUMP}+= kdump
SUBDIR.${MK_KDUMP}+= truss
SUBDIR.${MK_KERBEROS_SUPPORT}+= compile_et
SUBDIR.${MK_LDNS_UTILS}+= drill
SUBDIR.${MK_LDNS_UTILS}+= host
SUBDIR.${MK_LOCATE}+= locate
# XXX msgs?
.if ${MK_MAIL} != "no"
SUBDIR+= biff
SUBDIR+= from
SUBDIR+= mail
SUBDIR+= msgs
SUBDIR.${MK_MAIL}+= biff
SUBDIR.${MK_MAIL}+= from
SUBDIR.${MK_MAIL}+= mail
SUBDIR.${MK_MAIL}+= msgs
SUBDIR.${MK_MAKE}+= bmake
SUBDIR.${MK_MAN_UTILS}+= catman
.if ${MK_MANDOCDB} == "no" # AND
SUBDIR.${MK_MAN_UTILS}+= makewhatis
.endif
.if ${MK_MAKE} != "no"
SUBDIR+= bmake
.endif
.if ${MK_MAN_UTILS} != "no"
SUBDIR+= catman
.if ${MK_MANDOCDB} == "no"
SUBDIR+= makewhatis
.endif
SUBDIR+= man
.endif
.if ${MK_NETCAT} != "no"
SUBDIR+= nc
.endif
.if ${MK_NIS} != "no"
SUBDIR+= ypcat
SUBDIR+= ypmatch
SUBDIR+= ypwhich
.endif
.if ${MK_OPENSSH} != "no"
SUBDIR+= ssh-copy-id
.endif
.if ${MK_OPENSSL} != "no"
SUBDIR+= bc
SUBDIR+= chkey
SUBDIR+= dc
SUBDIR+= newkey
.endif
.if ${MK_QUOTAS} != "no"
SUBDIR+= quota
.endif
.if ${MK_RCMDS} != "no"
SUBDIR+= rlogin
SUBDIR+= rsh
SUBDIR+= ruptime
SUBDIR+= rwho
.endif
.if ${MK_SENDMAIL} != "no"
SUBDIR+= vacation
.endif
.if ${MK_TALK} != "no"
SUBDIR+= talk
.endif
.if ${MK_TELNET} != "no"
SUBDIR+= telnet
.endif
.if ${MK_TESTS} != "no"
SUBDIR+= tests
.endif
.if ${MK_TEXTPROC} != "no"
SUBDIR+= checknr
SUBDIR+= colcrt
SUBDIR+= ul
.endif
.if ${MK_TFTP} != "no"
SUBDIR+= tftp
.endif
.if ${MK_TOOLCHAIN} != "no"
SUBDIR+= addr2line
SUBDIR+= ar
SUBDIR+= c89
SUBDIR+= c99
SUBDIR+= ctags
SUBDIR+= cxxfilt
SUBDIR+= elfcopy
SUBDIR+= file2c
SUBDIR.${MK_MAN_UTILS}+= man
SUBDIR.${MK_NETCAT}+= nc
SUBDIR.${MK_NIS}+= ypcat
SUBDIR.${MK_NIS}+= ypmatch
SUBDIR.${MK_NIS}+= ypwhich
SUBDIR.${MK_OPENSSH}+= ssh-copy-id
SUBDIR.${MK_OPENSSL}+= bc
SUBDIR.${MK_OPENSSL}+= chkey
SUBDIR.${MK_OPENSSL}+= dc
SUBDIR.${MK_OPENSSL}+= newkey
SUBDIR.${MK_QUOTAS}+= quota
SUBDIR.${MK_RCMDS}+= rlogin
SUBDIR.${MK_RCMDS}+= rsh
SUBDIR.${MK_RCMDS}+= ruptime
SUBDIR.${MK_RCMDS}+= rwho
SUBDIR.${MK_SENDMAIL}+= vacation
SUBDIR.${MK_TALK}+= talk
SUBDIR.${MK_TELNET}+= telnet
SUBDIR.${MK_TESTS}+= tests
SUBDIR.${MK_TEXTPROC}+= checknr
SUBDIR.${MK_TEXTPROC}+= colcrt
SUBDIR.${MK_TEXTPROC}+= ul
SUBDIR.${MK_TFTP}+= tftp
SUBDIR.${MK_TOOLCHAIN}+= addr2line
SUBDIR.${MK_TOOLCHAIN}+= ar
SUBDIR.${MK_TOOLCHAIN}+= c89
SUBDIR.${MK_TOOLCHAIN}+= c99
SUBDIR.${MK_TOOLCHAIN}+= ctags
SUBDIR.${MK_TOOLCHAIN}+= cxxfilt
SUBDIR.${MK_TOOLCHAIN}+= elfcopy
SUBDIR.${MK_TOOLCHAIN}+= file2c
.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO gprof does not build
SUBDIR+= gprof
SUBDIR.${MK_TOOLCHAIN}+= gprof
.endif
SUBDIR+= indent
SUBDIR+= lex
SUBDIR+= mkstr
SUBDIR+= nm
SUBDIR+= readelf
SUBDIR+= rpcgen
SUBDIR+= unifdef
SUBDIR+= size
SUBDIR+= strings
SUBDIR.${MK_TOOLCHAIN}+= indent
SUBDIR.${MK_TOOLCHAIN}+= lex
SUBDIR.${MK_TOOLCHAIN}+= mkstr
SUBDIR.${MK_TOOLCHAIN}+= nm
SUBDIR.${MK_TOOLCHAIN}+= readelf
SUBDIR.${MK_TOOLCHAIN}+= rpcgen
SUBDIR.${MK_TOOLCHAIN}+= unifdef
SUBDIR.${MK_TOOLCHAIN}+= size
SUBDIR.${MK_TOOLCHAIN}+= strings
.if ${MACHINE_ARCH} != "aarch64" # ARM64TODO xlint does not build
SUBDIR+= xlint
.endif
SUBDIR+= xstr
SUBDIR+= yacc
.endif
.if ${MK_VI} != "no"
SUBDIR+= vi
.endif
.if ${MK_VT} != "no"
SUBDIR+= vtfontcvt
.endif
.if ${MK_USB} != "no"
SUBDIR+= usbhidaction
SUBDIR+= usbhidctl
.endif
.if ${MK_UTMPX} != "no"
SUBDIR+= last
SUBDIR+= users
SUBDIR+= who
.endif
.if ${MK_SVN} == "yes" || ${MK_SVNLITE} == "yes"
SUBDIR+= svn
SUBDIR.${MK_TOOLCHAIN}+= xlint
.endif
SUBDIR.${MK_TOOLCHAIN}+= xstr
SUBDIR.${MK_TOOLCHAIN}+= yacc
SUBDIR.${MK_VI}+= vi
SUBDIR.${MK_VT}+= vtfontcvt
SUBDIR.${MK_USB}+= usbhidaction
SUBDIR.${MK_USB}+= usbhidctl
SUBDIR.${MK_UTMPX}+= last
SUBDIR.${MK_UTMPX}+= users
SUBDIR.${MK_UTMPX}+= who
SUBDIR.${MK_SVN}+= svn
SUBDIR.${MK_SVNLITE}+= svn
.include <bsd.arch.inc.mk>
SUBDIR:= ${SUBDIR:O}
SUBDIR:= ${SUBDIR:O:u}
SUBDIR_PARALLEL=