# HG changeset patch # Parent ad07e401ec2de8e3397075b95163780da8b445c9 # Parent 910181c9919ca0206f7af4b6256be9130396985a Leverage the fact that MK_foo are always defined to either yes or no and bmake's robustness of variable expansion to simplify the ifdef soup these files are growing. Use FILES.${MK_foo}+= files in preference to .if ${MK_foo} != "no" FILES+= files .endif separated by blank lines to save 3 lines per option we test. Include ${FILES.yes} at the end of FILES to pick these up. Assume the file list for each option is small and stable so place it on one line. Stop using the traditional _file = file construct as well to make things uniform. diff -r 910181c9919c etc/Makefile --- a/etc/Makefile +++ b/etc/Makefile @@ -4,15 +4,11 @@ .include SUBDIR= \ - newsyslog.conf.d + newsyslog.conf.d \ + ${SUBDIR.yes} -.if ${MK_SENDMAIL} != "no" -SUBDIR+=sendmail -.endif - -.if ${MK_TESTS} != "no" -SUBDIR+=tests -.endif +SUBDIR.${MK_SENDMAIL}+=sendmail +SUBDIR.${MK_TESTS}+=tests BIN1= crontab \ devd.conf \ @@ -52,7 +48,8 @@ BIN1= crontab \ shells \ sysctl.conf \ syslog.conf \ - termcap.small + termcap.small \ + ${BIN1.yes} .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" BIN1+= libmap32.conf @@ -78,105 +75,43 @@ BSM_ETC_DIR= ${DESTDIR}/etc/security # NB: keep these sorted by MK_* knobs -.if ${MK_AMD} != "no" -BIN1+= amd.map -.endif +BIN1.${MK_AMD}+= amd.map +BIN1.${MK_APM}+= apmd.conf +BIN1.${MK_AUTOFS}+= auto_master +BIN1.${MK_BSMTP}+= snmpd.config +BIN1.${MK_FREEBSD_UPDATE}+= freebsd-update.conf +BIN1.${MK_FTP}+= ftpusers +BIN1.${MK_INETD}+= inetd.conf +BIN1.${MK_LOCATE}+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc +BIN1.${MK_LPR}+= hosts.lpd printcap +BIN1.${MK_MAIL}+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc +BIN1.${MK_NTP}+= ntp.conf +BIN1.${MK_NS_CACHING}+= nscd.conf +BIN1.${MK_PORTSNAP}+= portsnap.conf +BIN1.${MK_PF}+= pf.os +BIN1.${MK_SENDMAIL}+= rc.sendmail +BIN1.${MK_TCSH}+= csh.cshrc csh.login csh.logout +BIN1.${MK_WIRELESS}+= regdomain.xml -.if ${MK_APM} != "no" -BIN1+= apmd.conf -.endif - -.if ${MK_AUTOFS} != "no" -BIN1+= auto_master -.endif - -.if ${MK_BSNMP} != "no" -BIN1+= snmpd.config -.endif - -.if ${MK_FREEBSD_UPDATE} != "no" -BIN1+= freebsd-update.conf -.endif - -.if ${MK_FTP} != "no" -BIN1+= ftpusers -.endif - -.if ${MK_INETD} != "no" -BIN1+= inetd.conf -.endif - -.if ${MK_LOCATE} != "no" -BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc -.endif - -.if ${MK_LPR} != "no" -BIN1+= hosts.lpd printcap -.endif - -.if ${MK_MAIL} != "no" -BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc -.endif - -.if ${MK_NTP} != "no" -BIN1+= ntp.conf -.endif - -.if ${MK_OPENSSH} != "no" -SSH= ${.CURDIR}/../crypto/openssh/ssh_config \ +SSH.${MK_OPENSSH}= \ + ${.CURDIR}/../crypto/openssh/ssh_config \ ${.CURDIR}/../crypto/openssh/sshd_config \ ${.CURDIR}/../crypto/openssh/moduli -.endif -.if ${MK_OPENSSL} != "no" -SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf -.endif - -.if ${MK_NS_CACHING} != "no" -BIN1+= nscd.conf -.endif - -.if ${MK_PORTSNAP} != "no" -BIN1+= portsnap.conf -.endif - -.if ${MK_PF} != "no" -BIN1+= pf.os -.endif - -.if ${MK_SENDMAIL} != "no" -BIN1+= rc.sendmail -.endif - -.if ${MK_TCSH} != "no" -BIN1+= csh.cshrc csh.login csh.logout -.endif - -.if ${MK_WIRELESS} != "no" -BIN1+= regdomain.xml -.endif +SSL.${MK_OPENSSL}= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf # -rwxr-xr-x root:wheel, for the new cron root:wheel BIN2= netstart pccard_ether rc.suspend rc.resume -MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist -.if ${MK_TESTS} != "no" -MTREE+= BSD.tests.dist -.endif -.if ${MK_SENDMAIL} != "no" -MTREE+= BSD.sendmail.dist -.endif -.if ${MK_DEBUG_FILES} != "no" -MTREE+= BSD.debug.dist -.endif +MTREE= BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist ${MTREE.yes} +MTREE.${MK_TESTS}+= BSD.tests.dist +MTREE.${MK_SENDMAIL}+= BSD.sendmail.dist +MTREE.${MK_DEBUG_FILES}+= BSD.debug.dist PPPCNF= ppp.conf -.if ${MK_SENDMAIL} == "no" -ETCMAIL=mailer.conf aliases -.else -ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \ - mailertable.sample aliases -.endif +ETCMAIL=mailer.conf aliases ${ETCMAIL.yes} +ETCMAIL.${MK_SENDMAIL}=Makefile README access.sample virtusertable.sample \ + mailertable.sample # Special top level files for FreeBSD FREEBSD=COPYRIGHT @@ -278,13 +213,13 @@ distribution: .if ${MK_SENDMAIL} != "no" ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution .endif -.if ${MK_OPENSSH} != "no" +.if !empty(${SSH.yes}) cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${SSH} ${DESTDIR}/etc/ssh + ${SSH.yes} ${DESTDIR}/etc/ssh .endif -.if ${MK_OPENSSL} != "no" +.if !empty(${SSL.yes}) cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ - ${SSL} ${DESTDIR}/etc/ssl + ${SSL.yes} ${DESTDIR}/etc/ssl .endif .if ${MK_KERBEROS} != "no" cd ${.CURDIR}/root; \ @@ -346,19 +281,12 @@ MTREE_CMD?= mtree MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ - mtree/BSD.include.dist /usr/include -.if ${MK_DEBUG_FILES} != "no" -MTREES+= mtree/BSD.debug.dist /usr/lib -.endif -.if ${MK_GROFF} != "no" -MTREES+= mtree/BSD.groff.dist /usr -.endif -.if ${MK_TESTS} != "no" -MTREES+= mtree/BSD.tests.dist ${TESTSBASE} -.endif -.if ${MK_SENDMAIL} != "no" -MTREES+= mtree/BSD.sendmail.dist / -.endif + mtree/BSD.include.dist /usr/include \ + ${MTREES.yes} +MTREES.${MK_DEBUG_FILES}+=mtree/BSD.debug.dist /usr/lib +MTREES.${MK_GROFF}+= mtree/BSD.groff.dist /usr +MTREES.${MK_TESTS}+= mtree/BSD.tests.dist ${TESTSBASE} +MTREES.${MK_SENDMAIL}+= mtree/BSD.sendmail.dist / .for mtree in ${LOCAL_MTREE} MTREES+= ../${mtree} / .endfor diff -r 910181c9919c etc/devd/Makefile --- a/etc/devd/Makefile +++ b/etc/devd/Makefile @@ -2,28 +2,19 @@ .include -FILES= +FILES=${FILES.yes} .if ${MACHINE} == "powerpc" FILES+= apple.conf .endif .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" -.if ${MK_ACPI} != "no" -FILES+= asus.conf -.endif -.if ${MK_HYPERV} != "no" -FILES+= hyperv.conf -.endif +FILES.${MK_ACPI}+= asus.conf +FILES.${MK_HYPERV}+= hyperv.conf .endif -.if ${MK_USB} != "no" -FILES+= uath.conf ulpt.conf usb.conf -.endif - -.if ${MK_ZFS} != "no" -FILES+= zfs.conf -.endif +FILES.${MK_USB}+= uath.conf ulpt.conf usb.conf +FILES.${MK_ZFS}+= zfs.conf NO_OBJ= FILESDIR= /etc/devd diff -r 910181c9919c etc/mtree/Makefile --- a/etc/mtree/Makefile +++ b/etc/mtree/Makefile @@ -8,20 +8,13 @@ FILES= ${_BSD.debug.dist} \ ${_BSD.sendmail.dist} \ ${_BSD.tests.dist} \ BSD.usr.dist \ - BSD.var.dist + BSD.var.dist \ + ${FILES.yes} -.if ${MK_DEBUG_FILES} != "no" -_BSD.debug.dist= BSD.debug.dist -.endif -.if ${MK_GROFF} != "no" -_BSD.groff.dist= BSD.groff.dist -.endif -.if ${MK_SENDMAIL} != "no" -_BSD.sendmail.dist= BSD.sendmail.dist -.endif -.if ${MK_TESTS} != "no" -_BSD.tests.dist= BSD.tests.dist -.endif +FILES.${MK_DEBUG_FILES}+= BSD.debug.dist +FILES.${MK_GROFF}+= BSD.groff.dist +FILES.${MK_SENDMAIL}+= BSD.sendmail.dist +FILES.${MK_TESTS}+= BSD.tests.dist NO_OBJ= FILESDIR= /etc/mtree diff -r 910181c9919c etc/newsyslog.conf.d/Makefile --- a/etc/newsyslog.conf.d/Makefile +++ b/etc/newsyslog.conf.d/Makefile @@ -4,10 +4,7 @@ BINDIR= /etc/newsyslog.conf.d -FILES= - -.if ${MK_OFED} != "no" -FILES+= opensm.conf -.endif +FILES=${FILES.yes} +FILES.${MK_OFED}+= opensm.conf .include diff -r 910181c9919c etc/periodic/monthly/Makefile --- a/etc/periodic/monthly/Makefile +++ b/etc/periodic/monthly/Makefile @@ -3,12 +3,9 @@ .include FILES= 450.status-security \ - 999.local + 999.local \ + ${FILES.yes} -# NB: keep these sorted by MK_* knobs - -.if ${MK_UTMPX} != "no" -FILES+= 200.accounting -.endif +FILES.${MK_UTMPX}+= 200.accounting .include diff -r 910181c9919c etc/periodic/security/Makefile --- a/etc/periodic/security/Makefile +++ b/etc/periodic/security/Makefile @@ -15,20 +15,8 @@ FILES= 100.chksetuid \ 900.tcpwrap DATA= security.functions -# NB: keep these sorted by MK_* knobs - -.if ${MK_IPFILTER} != "no" -FILES+= 510.ipfdenied -FILES+= 610.ipf6denied -.endif - -.if ${MK_IPFW} != "no" -FILES+= 500.ipfwdenied \ - 550.ipfwlimit -.endif - -.if ${MK_PF} != "no" -FILES+= 520.pfdenied -.endif +FILES.${MK_IPFILTER}+= 510.ipfdenied 610.ipf6denied +FILES.${MK_IPFW}+= 500.ipfwdenied 550.ipfwlimit +FILES.${MK_PF}+= 520.pfdenied .include diff -r 910181c9919c etc/periodic/weekly/Makefile --- a/etc/periodic/weekly/Makefile +++ b/etc/periodic/weekly/Makefile @@ -4,16 +4,10 @@ FILES= 340.noid \ 450.status-security \ - 999.local + 999.local \ + ${FILES.yes} -# NB: keep these sorted by MK_* knobs - -.if ${MK_LOCATE} != "no" -FILES+= 310.locate -.endif - -.if ${MK_MAN_UTILS} != "no" -FILES+= 320.whatis 330.catman -.endif +FILES.${MK_LOCATE}+= 310.locate +FILES.${MK_MAN_UTILS}+= 320.whatis 330.catman .include diff -r 910181c9919c etc/rc.d/Makefile --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -18,10 +18,7 @@ FILES= DAEMON \ auditd \ auditdistd \ bgfsck \ - ${_bluetooth} \ bridge \ - ${_bthidd} \ - ${_casperd} \ cleanvar \ cleartmp \ cron \ @@ -40,7 +37,6 @@ FILES= DAEMON \ gptboot \ growfs \ gssd \ - ${_hcsecd} \ hostid \ hostid_save \ hostname \ @@ -51,12 +47,8 @@ FILES= DAEMON \ ipmon \ ipnat \ ipsec \ - ${_kadmind} \ - ${_kdc} \ - ${_kfd} \ kld \ kldxref \ - ${_kpasswdd} \ ldconfig \ local \ localpkg \ @@ -81,10 +73,8 @@ FILES= DAEMON \ nfsd \ nfsuserd \ nisdomain \ - ${_nscd} \ nsswitch \ ntpdate \ - ${_opensm} \ pf \ pflog \ pfsync \ @@ -108,7 +98,6 @@ FILES= DAEMON \ securelevel \ serial \ sppp \ - ${_sshd} \ statd \ static_arp \ static_ndp \ @@ -118,10 +107,7 @@ FILES= DAEMON \ sysctl \ syslogd \ tmp \ - ${_ubthidhci} \ ugidfw \ - ${_unbound} \ - ${_utx} \ var \ watchdogd \ ypbind \ @@ -131,157 +117,42 @@ FILES= DAEMON \ ypupdated \ ypxfrd \ zfs \ - zvol + zvol \ + ${FILES.yes} -.if ${MK_ACCT} != "no" -FILES+= accounting -.endif - -.if ${MK_ACPI} != "no" -FILES+= power_profile -.endif - -.if ${MK_ACPI} != "no" || ${MK_APM} != "no" -FILES+= powerd -.endif - -.if ${MK_AMD} != "no" -FILES+= amd -.endif - -.if ${MK_APM} != "no" -FILES+= apm -FILES+= apmd -.endif - -.if ${MK_AUTOFS} != "no" -FILES+= automount -FILES+= automountd -FILES+= autounmountd -.endif - -.if ${MK_BLUETOOTH} != "no" -_bluetooth= bluetooth -_bthidd= bthidd -_hcsecd= hcsecd -_ubthidhci= ubthidhci -.endif - -.if ${MK_BOOTPARAMD} != "no" -FILES+= bootparams -.endif - -.if ${MK_BSNMP} != "no" -FILES+= bsnmpd -.endif - -.if ${MK_CASPER} != "no" -_casperd= casperd -.endif - -.if ${MK_CCD} != "no" -FILES+= ccd -.endif - -.if ${MK_FTP} != "no" -FILES+= ftpd -.endif - -.if ${MK_HAST} != "no" -FILES+= hastd -.endif - -.if ${MK_INETD} != "no" -FILES+= inetd -.endif - -.if ${MK_ISCSI} != "no" -FILES+= iscsictl -FILES+= iscsid -.endif - -.if ${MK_JAIL} != "no" -FILES+= jail -.endif - -.if ${MK_LEGACY_CONSOLE} != "no" -FILES+= moused -FILES+= syscons -.endif - -.if ${MK_LPR} != "no" -FILES+= lpd -.endif - -.if ${MK_KERBEROS} != "no" -FILES+= ipropd_master -FILES+= ipropd_slave -_kadmind= kadmind -_kdc= kdc -_kfd= kfd -_kpasswdd= kpasswdd -.endif - -.if ${MK_MAIL} != "no" -FILES+= othermta -.endif - -.if ${MK_NS_CACHING} != "no" -_nscd= nscd -.endif - -.if ${MK_NTP} != "no" -FILES+= ntpd -.endif - -.if ${MK_OFED} != "no" -_opensm= opensm -.endif - -.if ${MK_OPENSSL} != "no" -FILES+= keyserv -.endif - -.if ${MK_OPENSSH} != "no" -_sshd= sshd -.endif - -.if ${MK_PF} != "no" -FILES+= ftp-proxy -.endif - -.if ${MK_RCMDS} != "no" -FILES+= rwho -.endif - -.if ${MK_ROUTED} != "no" -FILES+= routed -.endif - -.if ${MK_SENDMAIL} != "no" -FILES+= sendmail -.endif - -.if ${MK_TIMED} != "no" -FILES+= timed -.endif - -.if ${MK_UNBOUND} != "no" -_unbound= local_unbound -.endif - -.if ${MK_UTMPX} != "no" -_utx= utx -.endif - -.if ${MK_VI} != "no" -FILES+= virecover -.endif - -.if ${MK_WIRELESS} != "no" -FILES+= hostapd -FILES+= wpa_supplicant -.endif +FILES.${MK_ACCT}+= accounting +FILES.${MK_ACPI}+= power_profile powerd +FILES.${MK_APM}+= apm apmd powerd +FILES.${MK_AMD}+= amd +FILES.${MK_AUTOFS}+= automount automountd autounmountd +FILES.${MK_BLUETOOTH}+= bluetooth bthidd hcsecd ubthidhci +FILES.${MK_BOOTPARAMD}+= bootparams +FILES.${MK_BSNMP}+= bsnmpd +FILES.${MK_CASPER}+= casperd +FILES.${MK_CCD}+= ccd +FILES.${MK_FTP}+= ftpd +FILES.${MK_HAST}+= hastd +FILES.${MK_INETD}+= inetd +FILES.${MK_ISCSI}+= iscsictl iscsid +FILES.${MK_JAIL}+= jail +FILES.${MK_LEGACY_CONSOLE}+= moused syscons +FILES.${MK_LPR}+= lpd +FILES.${MK_KERBEROS}+= ipropd_master ipropd_slave kadmind kdc kfd kpasswdd +FILES.${MK_MAIL}+= othermta +FILES.${MK_NS_CACHING}+= nscd +FILES.${MK_NTP}+= ntpd +FILES.${MK_OFED}+= opensm +FILES.${MK_OPENSSL}+= keyserv +FILES.${MK_OPENSSH}+= sshd +FILES.${MK_PF}+= ftp-proxy +FILES.${MK_RCMDS}+= rwho +FILES.${MK_ROUTED}+= routed +FILES.${MK_SENDMAIL}+= sendmail +FILES.${MK_TIMED}+= timed +FILES.${MK_UNBOUND}+= local_unbound +FILES.${MK_UTMPX}+= utx +FILES.${MK_VI}+= virecover +FILES.${MK_WIRELESS}+= hostapd wpa_supplicant FILESDIR= /etc/rc.d FILESMODE= ${BINMODE}