4 .include "${SYSDIR}/conf/kern.opts.mk"
8 # Modules that include binary-only blobs of microcode should be selectable by
9 # MK_SOURCELESS_UCODE option (see below).
11 .include "${SYSDIR}/conf/config.mk"
13 .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
14 SUBDIR=${MODULES_OVERRIDE}
86 ${_chromebook_platform} \
222 ${_mac_bsdextended} \
233 ${_mac_seeotheruids} \
417 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
421 .if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
422 .if ${KERN_OPTS:MKDTRACE_HOOKS}
428 # Requires bus_space_read_8
429 .if ${MACHINE_ARCH} != "i386"
433 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
434 .if exists(${SRCTOP}/sys/opencrypto)
436 _cryptodev= cryptodev
437 _random_fortuna=random_fortuna
438 _random_other= random_other
442 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
446 .if ${MK_EFI} != "no"
447 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
452 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
459 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
462 _ipfw_pmod= ipfw_pmod
463 .if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
466 .if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
471 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
476 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
479 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
480 _ipfw_nat64= ipfw_nat64
484 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
485 _ipfw_nptv6= ipfw_nptv6
488 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
492 .if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
493 _dpdk_lpm4= dpdk_lpm4
497 .if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
498 _dpdk_lpm6= dpdk_lpm6
501 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
511 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
512 ${MACHINE_CPUARCH} == "i386"
516 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
519 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
521 SUBDIR+= linux_common
524 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
525 ${MACHINE_CPUARCH} == "i386"
527 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
534 .if ${MK_SOURCELESS_UCODE} != "no"
535 _iwlwififw= iwlwififw
539 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
544 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
551 .if ${MK_SOURCELESS_UCODE} != "no"
558 .if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
560 _mac_bsdextended= mac_bsdextended
561 .if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
564 _mac_ifoff= mac_ifoff
565 _mac_lomac= mac_lomac
569 _mac_partition= mac_partition
571 _mac_portacl= mac_portacl
572 _mac_priority= mac_priority
573 _mac_seeotheruids= mac_seeotheruids
578 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
582 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
583 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
586 .if ${MK_INET_SUPPORT} != "no"
591 .if ${MK_SOURCELESS_UCODE} != "no"
602 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
603 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
604 ${MACHINE_CPUARCH} != "riscv"
608 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm64" || ${MACHINE_ARCH:Mpowerpc64*}
610 .if ${MK_SOURCELESS_UCODE} != "no"
613 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
614 .if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
620 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
621 ${MACHINE_CPUARCH} == "riscv"
627 # These rely on 64bit atomics
628 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
633 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
637 .if ${MK_ZFS} != "no" || (defined(ALL_MODULES) && ${MACHINE_CPUARCH} != "powerpc")
641 .if ${MK_SOURCELESS_UCODE} != "no"
645 .if ${MACHINE_CPUARCH} == "aarch64"
646 _armv8crypto= armv8crypto
652 _allwinner= allwinner
660 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
662 _sdhci_fdt= sdhci_fdt
668 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
670 .if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
674 .if ${MK_SOURCELESS_UCODE} != "no"
691 .if ${MK_SOURCELESS_UCODE} != "no"
702 _qat_c2xxx= qat_c2xxx
703 _qat_c2xxxfw= qat_c2xxxfw
704 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
717 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
720 _amd_ecc_inject=amd_ecc_inject
726 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
732 _chromebook_platform= chromebook_platform
734 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
738 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
753 .if ${MK_SOURCELESS_UCODE} != "no"
763 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
765 _padlock_rng= padlock_rng
766 _rdrand_rng= rdrand_rng
770 _sdhci_acpi= sdhci_acpi
777 .if ${MK_SOURCELESS_UCODE} != "no"
783 .if ${MACHINE_CPUARCH} == "amd64"
795 .if ${MK_SOURCELESS_UCODE} != "no"
801 _sgx_linux= sgx_linux
805 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
806 .if ${KERN_OPTS:MSMP}
812 .if ${MACHINE_CPUARCH} == "i386"
813 # XXX some of these can move to the general case when de-i386'ed
814 # XXX some of these can move now, but are untested on other architectures.
816 _3dfx_linux= 3dfx_linux
824 .if ${MACHINE_ARCH} == "armv7"
829 .if ${MACHINE_CPUARCH} == "powerpc"
843 .if ${MACHINE_ARCH:Mpowerpc64*} != ""
848 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
849 # Don't build powermac_nvram for powerpcspe, it's never supported.
850 _nvram+= powermac_nvram
853 .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
854 _bcm283x_clkman= bcm283x_clkman
855 _bcm283x_pwm= bcm283x_pwm
858 .if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
859 # LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
860 # https://bugs.llvm.org/show_bug.cgi?id=44351
864 SUBDIR+=${MODULES_EXTRA}
866 .for reject in ${WITHOUT_MODULES}
867 SUBDIR:= ${SUBDIR:N${reject}}
870 .endif # MODULES_OVERRIDE -- Keep last
872 # Calling kldxref(8) for each module is expensive.
873 .if !defined(NO_XREF)
874 .MAKEFLAGS+= -DNO_XREF
876 @if type kldxref >/dev/null 2>&1; then \
877 ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
878 ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
882 SUBDIR:= ${SUBDIR:u:O}
884 .include <bsd.subdir.mk>