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}
87 ${_chromebook_platform} \
223 ${_mac_bsdextended} \
234 ${_mac_seeotheruids} \
416 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
420 .if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
421 .if ${KERN_OPTS:MKDTRACE_HOOKS}
427 # Requires bus_space_read_8
428 .if ${MACHINE_ARCH} != "i386"
432 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
433 .if exists(${SRCTOP}/sys/opencrypto)
435 _cryptodev= cryptodev
436 _random_fortuna=random_fortuna
437 _random_other= random_other
441 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
445 .if ${MK_EFI} != "no"
446 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
451 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
458 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
461 _ipfw_pmod= ipfw_pmod
462 .if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
465 .if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
470 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
475 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
478 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
479 _ipfw_nat64= ipfw_nat64
483 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
484 _ipfw_nptv6= ipfw_nptv6
487 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
491 .if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
492 _dpdk_lpm4= dpdk_lpm4
496 .if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
497 _dpdk_lpm6= dpdk_lpm6
500 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
510 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
511 ${MACHINE_CPUARCH} == "i386"
515 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
518 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
520 SUBDIR+= linux_common
523 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
524 ${MACHINE_CPUARCH} == "i386"
526 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
533 .if ${MK_SOURCELESS_UCODE} != "no"
534 _iwlwififw= iwlwififw
538 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
543 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
550 .if ${MK_SOURCELESS_UCODE} != "no"
557 .if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
559 _mac_bsdextended= mac_bsdextended
560 .if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
563 _mac_ifoff= mac_ifoff
564 _mac_lomac= mac_lomac
568 _mac_partition= mac_partition
570 _mac_portacl= mac_portacl
571 _mac_priority= mac_priority
572 _mac_seeotheruids= mac_seeotheruids
577 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
581 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
582 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
585 .if ${MK_INET_SUPPORT} != "no"
590 .if ${MK_SOURCELESS_UCODE} != "no"
601 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
602 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
603 ${MACHINE_CPUARCH} != "riscv"
607 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "arm64" || ${MACHINE_ARCH:Mpowerpc64*}
609 .if ${MK_SOURCELESS_UCODE} != "no"
612 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
613 .if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
619 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
620 ${MACHINE_CPUARCH} == "riscv"
626 # These rely on 64bit atomics
627 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
632 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
636 .if ${MK_ZFS} != "no" || (defined(ALL_MODULES) && ${MACHINE_CPUARCH} != "powerpc")
640 .if ${MK_SOURCELESS_UCODE} != "no"
644 .if ${MACHINE_CPUARCH} == "aarch64"
645 _armv8crypto= armv8crypto
651 _allwinner= allwinner
659 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
661 _sdhci_fdt= sdhci_fdt
667 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
669 .if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
673 .if ${MK_SOURCELESS_UCODE} != "no"
690 .if ${MK_SOURCELESS_UCODE} != "no"
701 _qat_c2xxx= qat_c2xxx
702 _qat_c2xxxfw= qat_c2xxxfw
703 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
715 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
718 _amd_ecc_inject=amd_ecc_inject
724 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
730 _chromebook_platform= chromebook_platform
732 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
736 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
751 .if ${MK_SOURCELESS_UCODE} != "no"
761 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
763 _padlock_rng= padlock_rng
764 _rdrand_rng= rdrand_rng
768 _sdhci_acpi= sdhci_acpi
775 .if ${MK_SOURCELESS_UCODE} != "no"
781 .if ${MACHINE_CPUARCH} == "amd64"
792 .if ${MK_SOURCELESS_UCODE} != "no"
798 _sgx_linux= sgx_linux
802 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
803 .if ${KERN_OPTS:MSMP}
809 .if ${MACHINE_CPUARCH} == "i386"
810 # XXX some of these can move to the general case when de-i386'ed
811 # XXX some of these can move now, but are untested on other architectures.
813 _3dfx_linux= 3dfx_linux
814 .if ${MK_SOURCELESS_HOST} != "no"
817 .if ${MK_SOURCELESS_HOST} != "no"
827 .if ${MACHINE_ARCH} == "armv7"
832 .if ${MACHINE_CPUARCH} == "powerpc"
846 .if ${MACHINE_ARCH:Mpowerpc64*} != ""
851 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
852 # Don't build powermac_nvram for powerpcspe, it's never supported.
853 _nvram+= powermac_nvram
856 .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
857 _bcm283x_clkman= bcm283x_clkman
858 _bcm283x_pwm= bcm283x_pwm
861 .if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
862 # LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
863 # https://bugs.llvm.org/show_bug.cgi?id=44351
867 SUBDIR+=${MODULES_EXTRA}
869 .for reject in ${WITHOUT_MODULES}
870 SUBDIR:= ${SUBDIR:N${reject}}
873 .endif # MODULES_OVERRIDE -- Keep last
875 # Calling kldxref(8) for each module is expensive.
876 .if !defined(NO_XREF)
877 .MAKEFLAGS+= -DNO_XREF
879 @if type kldxref >/dev/null 2>&1; then \
880 ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
881 ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
885 SUBDIR:= ${SUBDIR:u:O}
887 .include <bsd.subdir.mk>