3 .include "${SYSDIR}/conf/kern.opts.mk"
7 # Modules that include binary-only blobs of microcode should be selectable by
8 # MK_SOURCELESS_UCODE option (see below).
10 .include "${SYSDIR}/conf/config.mk"
12 .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
13 SUBDIR=${MODULES_OVERRIDE}
85 ${_chromebook_platform} \
224 ${_mac_bsdextended} \
236 ${_mac_seeotheruids} \
240 ${_mac_veriexec_sha1} \
241 ${_mac_veriexec_sha256} \
242 ${_mac_veriexec_sha384} \
243 ${_mac_veriexec_sha512} \
427 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
431 .if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
432 .if ${KERN_OPTS:MKDTRACE_HOOKS}
438 # Requires bus_space_read_8
439 .if ${MACHINE_ARCH} != "i386"
443 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
444 .if exists(${SRCTOP}/sys/opencrypto)
446 _cryptodev= cryptodev
447 _random_fortuna=random_fortuna
448 _random_other= random_other
452 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
456 .if ${MK_EFI} != "no"
457 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
462 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
469 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
472 _ipfw_pmod= ipfw_pmod
473 .if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
476 .if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
481 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
486 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
489 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
490 _ipfw_nat64= ipfw_nat64
494 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
495 _ipfw_nptv6= ipfw_nptv6
498 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
502 .if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
503 _dpdk_lpm4= dpdk_lpm4
507 .if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
508 _dpdk_lpm6= dpdk_lpm6
511 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
521 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
522 ${MACHINE_CPUARCH} == "i386"
526 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
529 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
531 SUBDIR+= linux_common
534 .if ${MACHINE_CPUARCH} != "arm"
535 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
544 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
545 ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH:Mpowerpc64*} != ""
549 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
554 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
560 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
561 ${MACHINE_CPUARCH} == "i386"
565 .if ${MK_SOURCELESS_UCODE} != "no"
566 _iwlwififw= iwlwififw
574 .if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
576 _mac_bsdextended= mac_bsdextended
577 .if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
580 _mac_ifoff= mac_ifoff
581 _mac_ipacl= mac_ipacl
582 _mac_lomac= mac_lomac
586 _mac_partition= mac_partition
588 _mac_portacl= mac_portacl
589 _mac_priority= mac_priority
590 _mac_seeotheruids= mac_seeotheruids
593 .if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
594 _mac_veriexec= mac_veriexec
595 _mac_veriexec_sha1= mac_veriexec_sha1
596 _mac_veriexec_sha256= mac_veriexec_sha256
597 _mac_veriexec_sha384= mac_veriexec_sha384
598 _mac_veriexec_sha512= mac_veriexec_sha512
602 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
606 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
607 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
610 .if ${MK_INET_SUPPORT} != "no"
615 .if ${MK_SOURCELESS_UCODE} != "no"
626 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
627 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
628 ${MACHINE_CPUARCH} != "riscv"
632 # This has only been tested on amd64 and arm64
633 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
637 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
638 ${MACHINE_ARCH:Mpowerpc64*}
640 .if ${MK_SOURCELESS_UCODE} != "no"
643 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
644 .if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
650 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
651 ${MACHINE_CPUARCH} == "riscv"
657 # These rely on 64bit atomics
658 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
663 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
668 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
672 .if ${MK_SOURCELESS_UCODE} != "no"
676 .if ${MACHINE_CPUARCH} == "aarch64"
677 _armv8crypto= armv8crypto
678 _armv8_rng= armv8_rng
685 _allwinner= allwinner
693 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
695 _sdhci_fdt= sdhci_fdt
701 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
703 .if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
707 .if ${MK_SOURCELESS_UCODE} != "no"
725 .if ${MK_SOURCELESS_UCODE} != "no"
735 _qat_c2xxx= qat_c2xxx
736 _qat_c2xxxfw= qat_c2xxxfw
747 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
750 _amd_ecc_inject=amd_ecc_inject
756 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
762 _chromebook_platform= chromebook_platform
764 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
768 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
783 .if ${MK_SOURCELESS_UCODE} != "no"
793 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
795 _padlock_rng= padlock_rng
796 _rdrand_rng= rdrand_rng
800 _sdhci_acpi= sdhci_acpi
807 .if ${MK_SOURCELESS_UCODE} != "no"
813 .if ${MACHINE_CPUARCH} == "amd64"
823 .if ${MK_SOURCELESS_UCODE} != "no"
829 .if ${MK_SOURCELESS_UCODE} != "no"
835 _sgx_linux= sgx_linux
839 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
840 .if ${KERN_OPTS:MSMP}
846 .if ${MACHINE_CPUARCH} == "i386"
847 # XXX some of these can move to the general case when de-i386'ed
848 # XXX some of these can move now, but are untested on other architectures.
850 _3dfx_linux= 3dfx_linux
858 .if ${MACHINE_ARCH} == "armv7"
863 .if ${MACHINE_CPUARCH} == "powerpc"
877 .if ${MACHINE_ARCH:Mpowerpc64*} != ""
882 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
883 # Don't build powermac_nvram for powerpcspe, it's never supported.
884 _nvram+= powermac_nvram
887 .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
888 _bcm283x_clkman= bcm283x_clkman
889 _bcm283x_pwm= bcm283x_pwm
892 .if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
893 # LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
894 # https://bugs.llvm.org/show_bug.cgi?id=44351
898 SUBDIR+=${MODULES_EXTRA}
900 .for reject in ${WITHOUT_MODULES}
901 SUBDIR:= ${SUBDIR:N${reject}}
904 .endif # MODULES_OVERRIDE -- Keep last
906 # Calling kldxref(8) for each module is expensive.
907 .if !defined(NO_XREF)
908 .MAKEFLAGS+= -DNO_XREF
910 @if type kldxref >/dev/null 2>&1; then \
911 ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
912 ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
916 SUBDIR:= ${SUBDIR:u:O}
918 .include <bsd.subdir.mk>