Index: sys/modules/Makefile =================================================================== --- sys/modules/Makefile +++ sys/modules/Makefile @@ -1,830 +1,609 @@ # $FreeBSD$ +# +# When MODULES_OVERRIDE is set, exactly that list of modules is built. +# Otherwise, this makefile searches for ./*/Makefile, filters the resulting +# dirname list using the dirname.Ifxxxx variables defined below, and adds +# everything that survives the filters to SUBDIR for building. +# +# The filtering starts by assuming the dir is going to be added, then checks +# the dir.Ifxxxx variables, as follows: +# +# - IfArch - One or more MACHINE_ARCH values. +# - IfCpuArch - One or more MACHINE_CPUARCH values. +# If either exists, then the build-for arch or cpuarch must be in the list. +# +# - NoArch - One or more MACHINE_ARCH values. +# - NoCpuArch - One or more MACHINE_CPUARCH values. +# If either exists, then the build-for arch or cpuarch must not be in the list. +# +# - IfOpt - One or more ${MK_FOO} options. +# If it exists, the expansion of the variable must contain at least one +# instance of the word 'yes'. +# +# - IfOpt2 - One or more tuples of ${MK_FOO1}+${MK_FOO2}. +# If it exists, the expansion of the variable must contain at least one +# instance of the sequence 'yes+yes'. +# +# On a LINT kernel build, the ALL_MODULES variable will be defined. When +# defined the filtering based on options is disabled, but arch filtering +# still happens. +# +# Some modules are intended to be built only when specifically requested, +# by either the user or the kernel config makeoptions setting build variables. +# It's nice to have these built automatically on a LINT build but not with +# any other kernel config. This is accomplished by setting IfOpt=LintOnly. +# Since the line never contains 'yes' the module is never automatically built, +# except when ALL_MODULES is defined by LINT to disable option checking. SYSDIR?=${SRCTOP}/sys .include "${SYSDIR}/conf/kern.opts.mk" SUBDIR_PARALLEL= -# Modules that include binary-only blobs of microcode should be selectable by -# MK_SOURCELESS_UCODE option (see below). +# Stuff that's filtered out of all builds because of compiler errors. +# These need to get fixed or deleted. +cx.IfCpuArch= i386-BROKEN +epoch_test.IfCpuArch= BROKEN # API changed +ibcs2.IfCpuArch= BROKEN # amd64: struct trapframe errors, i386: sys_pipe undeclared +ixlv.IfCpuArch= BROKEN # errors in iflib.h +rc.IfCpuArch= BROKEN # uses obsolete opt_tty.h +sio.IfCpuArch= BROKEN # never converted to new tty layer -.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) -SUBDIR=${MODULES_OVERRIDE} -.else -SUBDIR= \ - ${_3dfx} \ - ${_3dfx_linux} \ - ${_aac} \ - ${_aacraid} \ - accf_data \ - accf_dns \ - accf_http \ - acl_nfs4 \ - acl_posix1e \ - ${_acpi} \ - ae \ - ${_aesni} \ - age \ - ${_agp} \ - aha \ - ahci \ - ${_aic} \ - aic7xxx \ - alc \ - ale \ - alq \ - ${_amd_ecc_inject} \ - ${_amdsbwd} \ - ${_amdsmn} \ - ${_amdtemp} \ - amr \ - ${_an} \ - ${_aout} \ - ${_apm} \ - ${_arcmsr} \ - ${_allwinner} \ - ${_armv8crypto} \ - ${_asmc} \ - ata \ - ath \ - ath_dfs \ - ath_hal \ - ath_hal_ar5210 \ - ath_hal_ar5211 \ - ath_hal_ar5212 \ - ath_hal_ar5416 \ - ath_hal_ar9300 \ - ath_main \ - ath_rate \ - ath_pci \ - ${_autofs} \ - ${_auxio} \ - ${_bce} \ - ${_bcm283x_clkman} \ - ${_bcm283x_pwm} \ - bfe \ - bge \ - bhnd \ - ${_bxe} \ - ${_bios} \ - ${_bktr} \ - ${_blake2} \ - ${_bm} \ - bnxt \ - bridgestp \ - bwi \ - bwn \ - ${_bytgpio} \ - ${_chvgpio} \ - cam \ - ${_cardbus} \ - ${_carp} \ - cas \ - ${_cbb} \ - cc \ - ${_ccp} \ - cd9660 \ - cd9660_iconv \ - ${_ce} \ - ${_cfi} \ - ${_chromebook_platform} \ - ${_ciss} \ - cloudabi \ - ${_cloudabi32} \ - ${_cloudabi64} \ - ${_cmx} \ - ${_coff} \ - ${_coretemp} \ - ${_cp} \ - ${_cpsw} \ - ${_cpuctl} \ - ${_cpufreq} \ - ${_crypto} \ - ${_cryptodev} \ - ${_cs} \ - ${_ctau} \ - ctl \ - ${_cxgb} \ - ${_cxgbe} \ - dc \ - dcons \ - dcons_crom \ - de \ - ${_dpms} \ - ${_dpt} \ - ${_drm} \ - ${_drm2} \ - dummynet \ - ${_ed} \ - ${_efirt} \ - ${_em} \ - ${_ena} \ - ${_ep} \ - ${_epic} \ - esp \ - ${_et} \ - evdev \ - ${_ex} \ - ${_exca} \ - ext2fs \ - fdc \ - fdescfs \ - ${_fe} \ - ${_ffec} \ - filemon \ - firewire \ - firmware \ - fuse \ - ${_fxp} \ - gem \ - geom \ - ${_glxiic} \ - ${_glxsb} \ - gpio \ - hifn \ - hme \ - ${_hpt27xx} \ - ${_hptiop} \ - ${_hptmv} \ - ${_hptnr} \ - ${_hptrr} \ - hwpmc \ - ${_hwpmc_mips24k} \ - ${_hwpmc_mips74k} \ - ${_hyperv} \ - i2c \ - ${_ibcore} \ - ${_ibcs2} \ - ${_ichwd} \ - ${_ida} \ - if_bridge \ - if_disc \ - if_edsc \ - ${_if_enc} \ - if_epair \ - ${_if_gif} \ - ${_if_gre} \ - ${_if_me} \ - if_lagg \ - ${_if_ndis} \ - ${_if_stf} \ - if_tap \ - if_tun \ - if_vlan \ - if_vxlan \ - ${_iir} \ - imgact_binmisc \ - ${_intelspi} \ - ${_io} \ - ${_ioat} \ - ${_ipoib} \ - ${_ipdivert} \ - ${_ipfilter} \ - ${_ipfw} \ - ipfw_nat \ - ${_ipfw_nat64} \ - ${_ipfw_nptv6} \ - ${_ipfw_pmod} \ - ${_ipmi} \ - ip6_mroute_mod \ - ip_mroute_mod \ - ${_ips} \ - ${_ipsec} \ - ${_ipw} \ - ${_ipwfw} \ - ${_isci} \ - ${_iser} \ - isp \ - ${_ispfw} \ - ${_iwi} \ - ${_iwifw} \ - ${_iwm} \ - ${_iwmfw} \ - ${_iwn} \ - ${_iwnfw} \ - ${_ix} \ - ${_ixv} \ - ${_ixl} \ - jme \ - joy \ - kbdmux \ - kgssapi \ - kgssapi_krb5 \ - khelp \ - krpc \ - ksyms \ - le \ - lge \ - libalias \ - libiconv \ - libmchain \ - ${_linux} \ - ${_linux_common} \ - ${_linux64} \ - linuxkpi \ - ${_lio} \ - lpt \ - mac_biba \ - mac_bsdextended \ - mac_ifoff \ - mac_lomac \ - mac_mls \ - mac_none \ - mac_partition \ - mac_portacl \ - mac_seeotheruids \ - mac_stub \ - mac_test \ - malo \ - md \ - mdio \ - mem \ - mfi \ - mii \ - mlx \ - ${_mlx4} \ - ${_mlx4ib} \ - ${_mlx4en} \ - ${_mlx5} \ - ${_mlx5en} \ - ${_mlx5ib} \ - ${_mly} \ - mmc \ - mmcsd \ - mpr \ - mps \ - mpt \ - mqueue \ - mrsas \ - msdosfs \ - msdosfs_iconv \ - ${_mse} \ - msk \ - ${_mthca} \ - mvs \ - mwl \ - ${_mwlfw} \ - mxge \ - my \ - ${_nandfs} \ - ${_nandsim} \ - ${_ncr} \ - ${_nctgpio} \ - ${_ncv} \ - ${_ndis} \ - ${_netgraph} \ - ${_nfe} \ - nfscl \ - nfscommon \ - nfsd \ - nfslock \ - nfslockd \ - nfssvc \ - nge \ - nmdm \ - ${_nsp} \ - nullfs \ - ${_ntb} \ - ${_nvd} \ - ${_nvme} \ - ${_nvram} \ - oce \ - ${_ocs_fc} \ - otus \ - ${_otusfw} \ - ow \ - ${_padlock} \ - ${_padlock_rng} \ - ${_pccard} \ - ${_pcfclock} \ - pcn \ - ${_pf} \ - ${_pflog} \ - ${_pfsync} \ - plip \ - ${_pms} \ - ppbus \ - ppc \ - ppi \ - pps \ - procfs \ - proto \ - pseudofs \ - ${_pst} \ - pty \ - puc \ - ${_qlxge} \ - ${_qlxgb} \ - ${_qlxgbe} \ - ${_qlnx} \ - ral \ - ${_ralfw} \ - ${_random_fortuna} \ - ${_random_yarrow} \ - ${_random_other} \ - rc4 \ - ${_rdma} \ - ${_rdrand_rng} \ - re \ - rl \ - ${_rockchip} \ - rtwn \ - rtwn_pci \ - rtwn_usb \ - ${_rtwnfw} \ - ${_s3} \ - ${_safe} \ - ${_sbni} \ - scc \ - ${_scsi_low} \ - sdhci \ - ${_sdhci_acpi} \ - sdhci_pci \ - sem \ - send \ - ${_sf} \ - ${_sfxge} \ - sge \ - ${_sgx} \ - ${_sgx_linux} \ - siftr \ - siis \ - sis \ - sk \ - ${_smartpqi} \ - smbfs \ - sn \ - snp \ - sound \ - ${_speaker} \ - spi \ - ${_splash} \ - ${_sppp} \ - ste \ - ${_stg} \ - stge \ - ${_sym} \ - ${_syscons} \ - sysvipc \ - tcp \ - ${_ti} \ - tl \ - tmpfs \ - ${_toecore} \ - ${_tpm} \ - trm \ - ${_twa} \ - twe \ - tws \ - tx \ - ${_txp} \ - uart \ - ubsec \ - udf \ - udf_iconv \ - ufs \ - uinput \ - unionfs \ - usb \ - ${_vesa} \ - ${_virtio} \ - vge \ - ${_viawd} \ - videomode \ - vkbd \ - ${_vmm} \ - ${_vmware} \ - ${_vpo} \ - vr \ - vte \ - vx \ - wb \ - ${_wbwd} \ - ${_wi} \ - wlan \ - wlan_acl \ - wlan_amrr \ - wlan_ccmp \ - wlan_rssadapt \ - wlan_tkip \ - wlan_wep \ - wlan_xauth \ - ${_wpi} \ - ${_wpifw} \ - ${_x86bios} \ - ${_xe} \ - xl \ - zlib +# Normal modules that need filtering based on arch and/or MK_ options... -.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES) -_autofs= autofs -.endif +3dfx.IfCpuArch= i386 -.if ${MK_CDDL} != "no" || defined(ALL_MODULES) -.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \ - ${MACHINE_CPUARCH} != "mips" && \ - ${MACHINE_CPUARCH} != "sparc64" -SUBDIR+= dtrace -.endif -SUBDIR+= opensolaris -.endif +3dfx_linux.IfCpuArch= i386 -.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if exists(${SRCTOP}/sys/opencrypto) -_crypto= crypto -_cryptodev= cryptodev -_random_fortuna=random_fortuna -_random_yarrow= random_yarrow -_random_other= random_other -.endif -.endif +aac.IfCpuArch= amd64 i386 -.if ${MK_CUSE} != "no" || defined(ALL_MODULES) -SUBDIR+= cuse -.endif +aacraid.IfCpuArch= amd64 i386 -.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_carp= carp -_toecore= toecore -_if_enc= if_enc -_if_gif= if_gif -_if_gre= if_gre -_ipfw_pmod= ipfw_pmod -.if ${MK_IPSEC_SUPPORT} != "no" -_ipsec= ipsec -.endif -.endif +acpi.IfCpuArch= amd64 i386 -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_if_stf= if_stf +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 +aesni.IfCpuArch= BROKEN +.else +aesni.IfCpuArch= amd64 i386 +aesni.IfOpt= ${MK_CRYPT} .endif -.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) -_if_me= if_me -_ipdivert= ipdivert -_ipfw= ipfw -.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES) -_ipfw_nat64= ipfw_nat64 -.endif -.endif +agp.IfCpuArch= amd64 i386 +agp.IfCpuArch= powerpc -.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES) -_ipfw_nptv6= ipfw_nptv6 -.endif +aic.IfCpuArch= i386 -.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) -_ipfilter= ipfilter -.endif +allwinner.IfCpuArch= aarch64 -.if ${MK_ISCSI} != "no" || defined(ALL_MODULES) -SUBDIR+= cfiscsi -SUBDIR+= iscsi -SUBDIR+= iscsi_initiator -.endif +amd_ecc_inject.IfCpuArch= amd64 i386 -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_CPUARCH} == "i386" -SUBDIR+= linprocfs -SUBDIR+= linsysfs -.endif +amdsbwd.IfCpuArch= amd64 i386 -.if ${MK_NAND} != "no" || defined(ALL_MODULES) -_nandfs= nandfs -_nandsim= nandsim -.endif +amdsmn.IfCpuArch= amd64 i386 -.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES) -_netgraph= netgraph -.endif +amdtemp.IfCpuArch= amd64 i386 -.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \ - ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES) -_pf= pf -_pflog= pflog -.if ${MK_INET_SUPPORT} != "no" -_pfsync= pfsync -.endif -.endif +an.IfCpuArch= amd64 i386 powerpc -.if ${MK_SOURCELESS_UCODE} != "no" -_bce= bce -_fxp= fxp -_ispfw= ispfw -_sf= sf -_ti= ti -_txp= txp - -.if ${MACHINE_CPUARCH} != "mips" -_mwlfw= mwlfw -_otusfw= otusfw -_ralfw= ralfw -_rtwnfw= rtwnfw -.endif -.endif +aout.IfCpuArch= amd64 i386 -.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \ - ${MACHINE_CPUARCH} != "mips" && \ - ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \ - ${MACHINE_CPUARCH} != "riscv" -_cxgbe= cxgbe -.endif +apm.IfCpuArch= i386 -.if ${MK_TESTS} != "no" || defined(ALL_MODULES) -SUBDIR+= tests -.endif +ar71xx.IfCpuArch= mips +ar71xx.IfOpt= LintOnly -.if ${MK_ZFS} != "no" || defined(ALL_MODULES) -SUBDIR+= zfs -.endif +arcmsr.IfCpuArch= amd64 i386 -.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "") -_hwpmc_mips24k= hwpmc_mips24k -_hwpmc_mips74k= hwpmc_mips74k -.endif +armv8crypto.IfCpuArch= aarch64 -.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \ - ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \ - ${MACHINE_CPUARCH} != "riscv" -_syscons= syscons -_vpo= vpo -.endif +asmc.IfCpuArch= amd64 i386 -.if ${MACHINE_CPUARCH} != "mips" -# no BUS_SPACE_UNSPECIFIED -# No barrier instruction support (specific to this driver) -_sym= sym -# intr_disable() is a macro, causes problems -.if ${MK_SOURCELESS_UCODE} != "no" -_cxgb= cxgb -.endif -.endif +ath_ahb.IfCpuArch= mips +ath_ahb.IfOpt= LintOnly -.if ${MACHINE_CPUARCH} == "aarch64" -_allwinner= allwinner -_armv8crypto= armv8crypto -_efirt= efirt -_em= em -_rockchip= rockchip -.endif +autofs.IfOpt= ${MK_AUTOFS} -.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" -_agp= agp -_an= an -_aout= aout -_bios= bios -_bktr= bktr -.if ${MK_SOURCELESS_UCODE} != "no" -_bxe= bxe -.endif -_cardbus= cardbus -_cbb= cbb -_cpuctl= cpuctl -_cpufreq= cpufreq -_cs= cs -_dpms= dpms -_drm= drm -_drm2= drm2 -_ed= ed -_em= em -_ena= ena -_ep= ep -_et= et -_exca= exca -_fe= fe -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ibcore= ibcore -.endif -_if_ndis= if_ndis -_io= io -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_ipoib= ipoib -_iser= iser -.endif -_ix= ix -_ixv= ixv -_linux= linux -.if ${MK_SOURCELESS_UCODE} != "no" -_lio= lio -.endif -_nctgpio= nctgpio -_ndis= ndis -_ocs_fc= ocs_fc -_pccard= pccard -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_rdma= rdma -.endif -_safe= safe -_scsi_low= scsi_low -_speaker= speaker -_splash= splash -_sppp= sppp -_vmware= vmware -_wbwd= wbwd -_wi= wi -_xe= xe - -_aac= aac -_aacraid= aacraid -_acpi= acpi -.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 -_aesni= aesni -.endif -.endif -_amd_ecc_inject=amd_ecc_inject -_amdsbwd= amdsbwd -_amdsmn= amdsmn -_amdtemp= amdtemp -_arcmsr= arcmsr -_asmc= asmc -.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -_blake2= blake2 -.endif -_bytgpio= bytgpio -_chvgpio= chvgpio -_ciss= ciss -_chromebook_platform= chromebook_platform -_cmx= cmx -_coretemp= coretemp -.if ${MK_SOURCELESS_HOST} != "no" -_hpt27xx= hpt27xx -.endif -_hptiop= hptiop -.if ${MK_SOURCELESS_HOST} != "no" -_hptmv= hptmv -_hptnr= hptnr -_hptrr= hptrr -.endif -_hyperv= hyperv -_ichwd= ichwd -_ida= ida -_iir= iir -_intelspi= intelspi -_ipmi= ipmi -_ips= ips -_isci= isci -_ipw= ipw -_iwi= iwi -_iwm= iwm -_iwn= iwn -.if ${MK_SOURCELESS_UCODE} != "no" -_ipwfw= ipwfw -_iwifw= iwifw -_iwmfw= iwmfw -_iwnfw= iwnfw -.endif -_mlx4= mlx4 -_mlx5= mlx5 -.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \ - defined(ALL_MODULES) -_mlx4en= mlx4en -_mlx5en= mlx5en -.endif -.if ${MK_OFED} != "no" || defined(ALL_MODULES) -_mthca= mthca -_mlx4ib= mlx4ib -_mlx5ib= mlx5ib -.endif -_mly= mly -_nfe= nfe -_nvd= nvd -_nvme= nvme -_nvram= nvram -.if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -_padlock= padlock -_padlock_rng= padlock_rng -_rdrand_rng= rdrand_rng -.endif -_s3= s3 -_sdhci_acpi= sdhci_acpi -_tpm= tpm -_twa= twa -_vesa= vesa -_viawd= viawd -_virtio= virtio -_wpi= wpi -.if ${MK_SOURCELESS_UCODE} != "no" -_wpifw= wpifw -.endif -_x86bios= x86bios -.endif +auxio.IfCpuArch= sparc64 -.if ${MACHINE_CPUARCH} == "amd64" -_ccp= ccp -_efirt= efirt -_ioat= ioat -_ixl= ixl -_ixlv= ixlv -_linux64= linux64 -_linux_common= linux_common -_ntb= ntb -_pms= pms -_qlxge= qlxge -_qlxgb= qlxgb -.if ${MK_SOURCELESS_UCODE} != "no" -_qlxgbe= qlxgbe -_qlnx= qlnx -.endif -_sfxge= sfxge -_sgx= sgx -_sgx_linux= sgx_linux -_smartpqi= smartpqi +bce.IfOpt= ${MK_SOURCELESS_UCODE} -.if ${MK_BHYVE} != "no" || defined(ALL_MODULES) -_vmm= vmm -.endif -.endif +bcm283x_clkman.IfArch= aarch64 armv6 armv7 -.if ${MACHINE_CPUARCH} == "i386" -# XXX some of these can move to the general case when de-i386'ed -# XXX some of these can move now, but are untested on other architectures. -_3dfx= 3dfx -_3dfx_linux= 3dfx_linux -_aic= aic -_apm= apm -.if ${MK_SOURCELESS_UCODE} != "no" -_ce= ce -.endif -_coff= coff -.if ${MK_SOURCELESS_UCODE} != "no" -_cp= cp -.endif -_glxiic= glxiic -_glxsb= glxsb -#_ibcs2= ibcs2 -_mse= mse -_ncr= ncr -_ncv= ncv -_nsp= nsp -_pcfclock= pcfclock -_pst= pst -_sbni= sbni -_stg= stg -.if ${MK_SOURCELESS_UCODE} != "no" -_ctau= ctau -.endif -_dpt= dpt -_ex= ex -.endif +bcm283x_pwm.IfArch= aarch64 armv6 armv7 -.if ${MACHINE_CPUARCH} == "arm" -_cfi= cfi -_cpsw= cpsw -.endif +bios.IfCpuArch= amd64 i386 -.if ${MACHINE_CPUARCH} == "powerpc" -_agp= agp -_an= an -_bm= bm -_cardbus= cardbus -_cbb= cbb -_cfi= cfi -_cpufreq= cpufreq -_drm= drm -_exca= exca -_ffec= ffec -_nvd= nvd -_nvme= nvme -_pccard= pccard -_wi= wi -.endif +bktr.IfCpuArch= amd64 i386 -.if ${MACHINE_ARCH} == "powerpc64" -_drm2= drm2 -.endif -.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc" -# Don't build powermac_nvram for powerpcspe, it's never supported. -_nvram= powermac_nvram +blake2.IfCpuArch= amd64 i386 +blake2.IfOpt= ${MK_CRYPT} + +bm.IfCpuArch= powerpc + +bxe.IfCpuArch= amd64 i386 +bxe.IfOpt= ${MK_SOURCELESS_UCODE} + +bytgpio.IfCpuArch= amd64 i386 + +cardbus.IfCpuArch= amd64 i386 powerpc + +carp.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +cbb.IfCpuArch= amd64 i386 powerpc + +ccp.IfCpuArch= amd64 + +ce.IfCpuArch= i386 +ce.IfOpt= ${MK_SOURCELESS_UCODE} + +cfi.IfCpuArch= arm powerpc + +cfiscsi.IfOpt= ${MK_ISCSI} + +chromebook_platform.IfCpuArch= amd64 i386 + +chvgpio.IfCpuArch= amd64 i386 + +ciss.IfCpuArch= amd64 i386 + +cloudabi32.IfArch= aarch64 amd64 armv6 armv7 i386 + +cloudabi64.IfArch= aarch64 amd64 + +cmx.IfCpuArch= amd64 i386 + +coff.IfCpuArch= i386 + +coretemp.IfCpuArch= amd64 i386 + +cp.IfCpuArch= i386 +cp.IfOpt= ${MK_SOURCELESS_UCODE} + +cpsw.IfCpuArch= arm + +cpuctl.IfCpuArch= amd64 i386 + +cpufreq.IfCpuArch= amd64 i386 powerpc + +crypto.IfOpt= ${MK_CRYPT} + +cryptodev.IfOpt= ${MK_CRYPT} + +cs.IfCpuArch= amd64 i386 + +ctau.IfCpuArch= i386 +ctau.IfOpt= ${MK_SOURCELESS_UCODE} + +cuse.IfOpt= ${MK_CUSE} + +cxgb.IfOpt= ${MK_SOURCELESS_UCODE} +cxgb.NoCpuArch= mips + +cxgbe.IfOpt= ${MK_SOURCELESS_UCODE} +cxgbe.NoArch= powerpc powerpcspe +cxgbe.NoCpuArch= arm mips riscv + +dpms.IfCpuArch= amd64 i386 + +dpt.IfCpuArch= i386 + +drm.IfCpuArch= amd64 i386 powerpc + +drm2.IfArch= powerpc64 +drm2.IfCpuArch= amd64 i386 + +dtrace.IfOpt= ${MK_CDDL} +dtrace.NoArch= arm +dtrace.NoCpuArch= mips sparc64 + +ed.IfCpuArch= amd64 i386 + +efirt.IfCpuArch= aarch64 amd64 + +em.IfCpuArch= aarch64 amd64 i386 sparc64 + +ena.IfCpuArch= amd64 i386 + +ep.IfCpuArch= amd64 i386 + +epic.IfCpuArch= sparc64 + +et.IfCpuArch= amd64 i386 + +ex.IfCpuArch= i386 + +exca.IfCpuArch= amd64 i386 powerpc + +fe.IfCpuArch= amd64 i386 + +ffec.IfArch= armv7 powerpc + +fxp.IfOpt= ${MK_SOURCELESS_UCODE} + +glxiic.IfCpuArch= i386 + +glxsb.IfCpuArch= i386 + +hpt27xx.IfCpuArch= amd64 i386 +hpt27xx.IfOpt= ${MK_SOURCELESS_HOST} + +hptiop.IfCpuArch= amd64 i386 + +hptmv.IfCpuArch= amd64 i386 +hptmv.IfOpt= ${MK_SOURCELESS_HOST} + +hptnr.IfCpuArch= amd64 i386 +hptnr.IfOpt= ${MK_SOURCELESS_HOST} + +hptrr.IfCpuArch= amd64 i386 +hptrr.IfOpt= ${MK_SOURCELESS_HOST} + +hwpmc_mips24k.IfCpuArch= mips +hwpmc_mips24k.NoArch= mips64 + +hwpmc_mips74k.IfCpuArch= mips +hwpmc_mips74k.NoArch= mips64 + +hyperv.IfCpuArch= amd64 i386 + +ibcore.IfCpuArch= amd64 i386 +ibcore.IfOpt= ${MK_OFED} + +ichwd.IfCpuArch= amd64 i386 + +ida.IfCpuArch= amd64 i386 + +if_enc.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +if_gif.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +if_gre.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +if_me.IfOpt= ${MK_INET_SUPPORT} + +if_ndis.IfCpuArch= amd64 i386 + +if_stf.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +iir.IfCpuArch= amd64 i386 + +imx.IfArch= armv7 +imx.IfOpt= LintOnly + +intelspi.IfCpuArch= amd64 i386 + +io.IfCpuArch= amd64 i386 + +ioat.IfCpuArch= amd64 + +ipdivert.IfOpt= ${MK_INET_SUPPORT} + +ipfilter.IfOpt= ${MK_IPFILTER} + +ipfw.IfOpt= ${MK_INET_SUPPORT} + +ipfw_nat64.IfOpt2= ${MK_INET_SUPPORT}+${MK_INET6_SUPPORT} + +ipfw_nptv6.IfOpt= ${MK_INET6_SUPPORT} + +ipfw_pmod.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +ipmi.IfCpuArch= amd64 i386 + +ipoib.IfCpuArch= amd64 i386 +ipoib.IfOpt= ${MK_OFED} + +ips.IfCpuArch= amd64 i386 + +ipsec.IfOpt2= ${MK_INET_SUPPORT}+${MK_IPSEC_SUPPORT} ${MK_INET6_SUPPORT}+${MK_IPSEC_SUPPORT} + +ipw.IfCpuArch= amd64 i386 + +ipwfw.IfCpuArch= amd64 i386 +ipwfw.IfOpt= ${MK_SOURCELESS_UCODE} + +isci.IfCpuArch= amd64 i386 + +iscsi.IfOpt= ${MK_ISCSI} + +iscsi_initiator= ${MK_ISCSI} + +iser.IfCpuArch= amd64 i386 +iser.IfOpt= ${MK_OFED} + +ispfw.IfOpt= ${MK_SOURCELESS_UCODE} + +iwi.IfCpuArch= amd64 i386 + +iwifw.IfCpuArch= amd64 i386 +iwifw.IfOpt= ${MK_SOURCELESS_UCODE} + +iwm.IfCpuArch= amd64 i386 + +iwmfw.IfCpuArch= amd64 i386 +iwmfw.IfOpt= ${MK_SOURCELESS_UCODE} + +iwn.IfCpuArch= amd64 i386 + +iwnfw.IfCpuArch= amd64 i386 +iwnfw.IfOpt= ${MK_SOURCELESS_UCODE} + +ix.IfCpuArch= amd64 i386 + +ixl.IfCpuArch= amd64 + +ixlv.IfCpuArch= amd64 + +ixv.IfCpuArch= amd64 i386 + +linprocfs.IfCpuArch= aarch64 amd64 i386 + +linsysfs.IfCpuArch= aarch64 amd64 i386 + +linux.IfCpuArch= amd64 i386 + +linux64.IfCpuArch= amd64 + +linux_common.IfCpuArch= amd64 + +lio.IfCpuArch= amd64 i386 +lio.IfOpt= ${MK_SOURCELESS_UCODE} + +mlx4.IfCpuArch= amd64 i386 + +mlx4en.IfCpuArch= amd64 i386 +mlx4en.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +mlx4ib.IfCpuArch= amd64 i386 +mlx4ib.IfOpt= ${MK_OFED} + +mlx5.IfCpuArch= amd64 i386 + +mlx5en.IfCpuArch= amd64 i386 +mlx5en.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +mlx5ib.IfCpuArch= amd64 i386 +mlx5ib.IfOpt= ${MK_OFED} + +mly.IfCpuArch= amd64 i386 + +mse.IfCpuArch= i386 + +mthca.IfCpuArch= amd64 i386 +mthca.IfOpt= ${MK_OFED} + +mwlfw.IfOpt= ${MK_SOURCELESS_UCODE} +mwlfw.NoCpuArch= mips + +nandfs.IfOpt= ${MK_NAND} + +nandsim.IfOpt= ${MK_NAND} + +ncr.IfCpuArch= i386 + +nctgpio.IfCpuArch= amd64 i386 + +ncv.IfCpuArch= i386 + +ndis.IfCpuArch= amd64 i386 + +netfpga10g.IfOpt= LintOnly + +netgraph.IfOpt= ${MK_NETGRAPH} + +nfe.IfCpuArch= amd64 i386 + +nsp.IfCpuArch= i386 + +ntb.IfCpuArch= amd64 + +nvd.IfCpuArch= amd64 i386 + +nvd.IfCpuArch= powerpc + +nvme.IfCpuArch= amd64 i386 powerpc + +nvram.IfCpuArch= amd64 i386 + +ocs_fc.IfCpuArch= amd64 i386 + +opensolaris.IfOpt= ${MK_CDDL} + +otusfw.IfOpt= ${MK_SOURCELESS_UCODE} +otusfw.NoCpuArch= mips + +padlock.IfCpuArch= amd64 i386 +padlock.IfOpt= ${MK_CRYPT} + +padlock_rng.IfCpuArch= amd64 i386 +padlock_rng.IfOpt= ${MK_CRYPT} + +pccard.IfCpuArch= amd64 i386 +pccard.IfCpuArch= powerpc + +pcfclock.IfCpuArch= i386 + +pf.IfOpt2= ${MK_PF}+${MK_INET_SUPPORT} ${MK_PF}+${MK_INET6_SUPPORT} + +pflog.IfOpt2= ${MK_PF}+${MK_INET_SUPPORT} ${MK_PF}+${MK_INET6_SUPPORT} + +pfsync.IfOpt2= ${MK_PF}+${MK_INET_SUPPORT} + +pms.IfCpuArch= amd64 + +powermac_nvram.IfArch= powerpc powerpc64 + +pst.IfCpuArch= i386 + +qlnx.IfCpuArch= amd64 +qlnx.IfOpt= ${MK_SOURCELESS_UCODE} + +qlxgb.IfCpuArch= amd64 + +qlxgbe.IfCpuArch= amd64 +qlxgbe.IfOpt= ${MK_SOURCELESS_UCODE} + +qlxge.IfCpuArch= amd64 + +ralfw.IfOpt= ${MK_SOURCELESS_UCODE} +ralfw.NoCpuArch= mips + +random_fortuna.IfOpt= ${MK_CRYPT} + +random_other.IfOpt= ${MK_CRYPT} + +random_yarrow.IfOpt= ${MK_CRYPT} + +rdma.IfCpuArch= amd64 i386 +rdma.IfOpt= ${MK_OFED} + +rdrand_rng.IfCpuArch= amd64 i386 +rdrand_rng.IfOpt= ${MK_CRYPT} + +rockchip.IfCpuArch= aarch64 + +rtwnfw.IfOpt= ${MK_SOURCELESS_UCODE} +rtwnfw.NoCpuArch= mips + +rpi_ft5406.IfArch= armv6 +rpi_ft5406.IfOpt= LintOnly + +s3.IfCpuArch= amd64 i386 + +safe.IfCpuArch= amd64 i386 + +sbni.IfCpuArch= i386 + +scsi_low.IfCpuArch= amd64 i386 + +sdhci_acpi.IfCpuArch= amd64 i386 + +sf.IfOpt= ${MK_SOURCELESS_UCODE} + +sfxge.IfCpuArch= amd64 + +sgx.IfCpuArch= amd64 + +sgx_linux.IfCpuArch= amd64 + +smartpqi.IfCpuArch= amd64 + +speaker.IfCpuArch= amd64 i386 + +splash.IfCpuArch= amd64 i386 + +sppp.IfCpuArch= amd64 i386 + +stg.IfCpuArch= i386 + +sym.NoCpuArch= mips + +syscons.IfArch= amd64 i386 sparc64 + +tests.IfOpt= ${MK_TESTS} + +ti.IfOpt= ${MK_SOURCELESS_UCODE} + +toecore.IfOpt= ${MK_INET_SUPPORT} ${MK_INET6_SUPPORT} + +tpm.IfCpuArch= amd64 i386 + +tsec.IfArch= powerpc powerpcspe + +twa.IfCpuArch= amd64 i386 + +txp.IfOpt= ${MK_SOURCELESS_UCODE} + +vesa.IfCpuArch= amd64 i386 + +viawd.IfCpuArch= amd64 i386 + +virtio.IfCpuArch= amd64 i386 + +vmm.IfCpuArch= amd64 +vmm.IfOpt= ${MK_BHYVE} + +vmware.IfCpuArch= amd64 i386 + +vnic.IfCpuArch= aarch64 + +vpo.IfArch= amd64 i386 sparc64 + +wbwd.IfCpuArch= amd64 i386 + +wi.IfCpuArch= amd64 i386 powerpc + +wpi.IfCpuArch= amd64 i386 + +wpifw.IfCpuArch= amd64 i386 +wpifw.IfOpt= ${MK_SOURCELESS_UCODE} + +wtap.IfOpt= LintOnly # Requires VIMAGE, no MK_VIMAGE to key off of + +x86bios.IfCpuArch= amd64 i386 + +xe.IfCpuArch= amd64 i386 + +zfs.IfOpt= ${MK_ZFS} + + +# Generate the SUBDIR list... + +.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES) + +SUBDIR=${MODULES_OVERRIDE} + +.else # Generate the dir list + +# Find all first-level subdirs that contain a Makefile, and then iterate +# through that list applying any filters specified in the variables above. +_dirlist!= find ${.CURDIR} -name Makefile -mindepth 2 -maxdepth 2 +.for _dir in ${_dirlist:H:T} + +# By default we add everything that isn't filtered out somehow. +_add_it= yes + +# Combine the IfArch and IfCpuArch lists for the module. If the current +# build [cpu]arch is not in the list, filter out the module. +_archvec= ${${_dir}.IfArch:C/.*/arch=&/} ${${_dir}.IfCpuArch:C/.*/cpuarch=&/} +_archsel= ${_archvec:March=${MACHINE_ARCH}} ${_archvec:Mcpuarch=${MACHINE_CPUARCH}} +.if !empty(_archvec) && empty(_archsel) +_add_it= no .endif -.if ${MACHINE_CPUARCH} == "sparc64" -_auxio= auxio -_em= em -_epic= epic +# Combine the Noarch and NoCpuArch lists for the module, and if the current +# build [cpu]arch is in the list, filter out the module. +_archvec= ${${_dir}.NoArch:C/.*/arch=&/} ${${_dir}.NoCpuArch:C/.*/cpuarch=&/} +_archsel= ${_archvec:March=${MACHINE_ARCH}} ${_archvec:Mcpuarch=${MACHINE_CPUARCH}} +.if !empty(_archvec) && !empty(_archsel) +_add_it= no .endif -.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ - ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386") -_cloudabi32= cloudabi32 +# Filter out modules that require some MK_FOO option to be yes. +.if !empty(${_dir}.IfOpt) && empty(${_dir}.IfOpt:Myes) && !defined(ALL_MODULES) +_add_it= no .endif -.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" -_cloudabi64= cloudabi64 + +# Filter out modules that require some pair of MK_FOO options to both be yes. +.if !empty(${_dir}.IfOpt2) && empty(${_dir}.IfOpt2:Myes+yes) && !defined(ALL_MODULES) +_add_it= no .endif +# WITHOUT_MODULES -- set by some kernel configs; unconditionally excluded. +.if !empty(WITHOUT_MODULES:M${_dir}) +_add_it= no .endif -.if ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "aarch64" -_bcm283x_clkman= bcm283x_clkman -_bcm283x_pwm= bcm283x_pwm +# If it passed all the filters, add it to SUBDIR. +.if ${_add_it} == "yes" +SUBDIR+= ${_dir} .endif -SUBDIR+=${MODULES_EXTRA} +.endfor # _dir in _dirlist +.endif # Generate the dir list -.for reject in ${WITHOUT_MODULES} -SUBDIR:= ${SUBDIR:N${reject}} -.endfor +# MODULES_EXTRA -- set by some kernel configs; always included, no filtering. +SUBDIR+=${MODULES_EXTRA} # Calling kldxref(8) for each module is expensive. .if !defined(NO_XREF)