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}
84 ${_chromebook_platform} \
223 ${_mac_bsdextended} \
235 ${_mac_seeotheruids} \
239 ${_mac_veriexec_sha1} \
240 ${_mac_veriexec_sha256} \
241 ${_mac_veriexec_sha384} \
242 ${_mac_veriexec_sha512} \
426 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
430 .if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
431 .if ${KERN_OPTS:MKDTRACE_HOOKS}
437 # Requires bus_space_read_8
438 .if ${MACHINE_ARCH} != "i386"
442 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
443 .if exists(${SRCTOP}/sys/opencrypto)
445 _cryptodev= cryptodev
446 _random_fortuna=random_fortuna
447 _random_other= random_other
451 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
455 .if ${MK_EFI} != "no"
456 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
461 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
468 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
471 _ipfw_pmod= ipfw_pmod
472 .if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
475 .if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
480 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
485 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
488 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
489 _ipfw_nat64= ipfw_nat64
493 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
494 _ipfw_nptv6= ipfw_nptv6
497 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
501 .if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
502 _dpdk_lpm4= dpdk_lpm4
506 .if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
507 _dpdk_lpm6= dpdk_lpm6
510 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
520 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
521 ${MACHINE_CPUARCH} == "i386"
525 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
528 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
530 SUBDIR+= linux_common
533 .if ${MACHINE_CPUARCH} != "arm"
534 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
543 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
544 ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH:Mpowerpc64*} != ""
548 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
553 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
559 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
560 ${MACHINE_CPUARCH} == "i386"
564 .if ${MK_SOURCELESS_UCODE} != "no"
565 _iwlwififw= iwlwififw
573 .if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
575 _mac_bsdextended= mac_bsdextended
576 .if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
579 _mac_ifoff= mac_ifoff
580 _mac_ipacl= mac_ipacl
581 _mac_lomac= mac_lomac
585 _mac_partition= mac_partition
587 _mac_portacl= mac_portacl
588 _mac_priority= mac_priority
589 _mac_seeotheruids= mac_seeotheruids
592 .if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
593 _mac_veriexec= mac_veriexec
594 _mac_veriexec_sha1= mac_veriexec_sha1
595 _mac_veriexec_sha256= mac_veriexec_sha256
596 _mac_veriexec_sha384= mac_veriexec_sha384
597 _mac_veriexec_sha512= mac_veriexec_sha512
601 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
605 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
606 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
609 .if ${MK_INET_SUPPORT} != "no"
614 .if ${MK_SOURCELESS_UCODE} != "no"
625 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
626 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
627 ${MACHINE_CPUARCH} != "riscv"
631 # This has only been tested on amd64 and arm64
632 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
636 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
637 ${MACHINE_ARCH:Mpowerpc64*}
639 .if ${MK_SOURCELESS_UCODE} != "no"
642 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
643 .if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
649 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
650 ${MACHINE_CPUARCH} == "riscv"
656 # These rely on 64bit atomics
657 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
662 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
667 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
671 .if ${MK_SOURCELESS_UCODE} != "no"
675 .if ${MACHINE_CPUARCH} == "aarch64"
676 _armv8crypto= armv8crypto
683 _allwinner= allwinner
691 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
693 _sdhci_fdt= sdhci_fdt
699 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
701 .if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
705 .if ${MK_SOURCELESS_UCODE} != "no"
723 .if ${MK_SOURCELESS_UCODE} != "no"
733 _qat_c2xxx= qat_c2xxx
734 _qat_c2xxxfw= qat_c2xxxfw
745 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
748 _amd_ecc_inject=amd_ecc_inject
754 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
760 _chromebook_platform= chromebook_platform
762 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
766 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
781 .if ${MK_SOURCELESS_UCODE} != "no"
791 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
793 _padlock_rng= padlock_rng
794 _rdrand_rng= rdrand_rng
798 _sdhci_acpi= sdhci_acpi
805 .if ${MK_SOURCELESS_UCODE} != "no"
811 .if ${MACHINE_CPUARCH} == "amd64"
821 .if ${MK_SOURCELESS_UCODE} != "no"
827 .if ${MK_SOURCELESS_UCODE} != "no"
833 _sgx_linux= sgx_linux
837 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
838 .if ${KERN_OPTS:MSMP}
844 .if ${MACHINE_CPUARCH} == "i386"
845 # XXX some of these can move to the general case when de-i386'ed
846 # XXX some of these can move now, but are untested on other architectures.
848 _3dfx_linux= 3dfx_linux
856 .if ${MACHINE_ARCH} == "armv7"
861 .if ${MACHINE_CPUARCH} == "powerpc"
875 .if ${MACHINE_ARCH:Mpowerpc64*} != ""
880 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
881 # Don't build powermac_nvram for powerpcspe, it's never supported.
882 _nvram+= powermac_nvram
885 .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
886 _bcm283x_clkman= bcm283x_clkman
887 _bcm283x_pwm= bcm283x_pwm
890 .if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
891 # LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
892 # https://bugs.llvm.org/show_bug.cgi?id=44351
896 SUBDIR+=${MODULES_EXTRA}
898 .for reject in ${WITHOUT_MODULES}
899 SUBDIR:= ${SUBDIR:N${reject}}
902 .endif # MODULES_OVERRIDE -- Keep last
904 # Calling kldxref(8) for each module is expensive.
905 .if !defined(NO_XREF)
906 .MAKEFLAGS+= -DNO_XREF
908 @if type kldxref >/dev/null 2>&1; then \
909 ${ECHO} ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
910 ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}; \
914 SUBDIR:= ${SUBDIR:u:O}
916 .include <bsd.subdir.mk>