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} \
429 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
433 .if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
434 .if ${KERN_OPTS:MKDTRACE_HOOKS}
440 # Requires bus_space_read_8
441 .if ${MACHINE_ARCH} != "i386"
445 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
446 .if exists(${SRCTOP}/sys/opencrypto)
448 _cryptodev= cryptodev
449 _random_fortuna=random_fortuna
450 _random_other= random_other
454 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
458 .if ${MK_EFI} != "no"
459 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
464 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
471 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
474 _ipfw_pmod= ipfw_pmod
475 .if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
478 .if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
483 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
488 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
491 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
492 _ipfw_nat64= ipfw_nat64
496 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
497 _ipfw_nptv6= ipfw_nptv6
500 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
504 .if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
505 _dpdk_lpm4= dpdk_lpm4
509 .if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
510 _dpdk_lpm6= dpdk_lpm6
513 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
523 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
524 ${MACHINE_CPUARCH} == "i386"
528 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
531 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
533 SUBDIR+= linux_common
536 .if ${MACHINE_CPUARCH} != "arm"
537 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
546 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
547 ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH:Mpowerpc64*} != ""
551 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
556 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
562 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
563 ${MACHINE_CPUARCH} == "i386"
567 .if ${MK_SOURCELESS_UCODE} != "no"
568 _iwlwififw= iwlwififw
574 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
575 ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH} == "armv7"
580 .if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
582 _mac_bsdextended= mac_bsdextended
583 .if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
586 _mac_ifoff= mac_ifoff
587 _mac_ipacl= mac_ipacl
588 _mac_lomac= mac_lomac
592 _mac_partition= mac_partition
594 _mac_portacl= mac_portacl
595 _mac_priority= mac_priority
596 _mac_seeotheruids= mac_seeotheruids
599 .if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
600 _mac_veriexec= mac_veriexec
601 _mac_veriexec_sha1= mac_veriexec_sha1
602 _mac_veriexec_sha256= mac_veriexec_sha256
603 _mac_veriexec_sha384= mac_veriexec_sha384
604 _mac_veriexec_sha512= mac_veriexec_sha512
608 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
612 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
613 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
617 .if ${MK_INET_SUPPORT} != "no"
622 .if ${MK_SOURCELESS_UCODE} != "no"
633 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
634 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
635 ${MACHINE_CPUARCH} != "riscv"
639 # This has only been tested on amd64 and arm64
640 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
644 .if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
645 ${MACHINE_ARCH:Mpowerpc64*}
647 .if ${MK_SOURCELESS_UCODE} != "no"
650 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
651 .if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
657 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
658 ${MACHINE_CPUARCH} == "riscv"
664 # These rely on 64bit atomics
665 .if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
670 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
675 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
679 .if ${MK_SOURCELESS_UCODE} != "no"
683 .if ${MACHINE_CPUARCH} == "aarch64"
684 _armv8crypto= armv8crypto
685 _armv8_rng= armv8_rng
693 _allwinner= allwinner
701 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
703 _sdhci_fdt= sdhci_fdt
709 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
711 .if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
715 .if ${MK_SOURCELESS_UCODE} != "no"
733 .if ${MK_SOURCELESS_UCODE} != "no"
743 _qat_c2xxx= qat_c2xxx
744 _qat_c2xxxfw= qat_c2xxxfw
755 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
758 _amd_ecc_inject=amd_ecc_inject
764 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
770 _chromebook_platform= chromebook_platform
772 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
776 .if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
791 .if ${MK_SOURCELESS_UCODE} != "no"
801 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
803 _padlock_rng= padlock_rng
804 _rdrand_rng= rdrand_rng
808 _sdhci_acpi= sdhci_acpi
815 .if ${MK_SOURCELESS_UCODE} != "no"
821 .if ${MACHINE_CPUARCH} == "amd64"
831 .if ${MK_SOURCELESS_UCODE} != "no"
837 .if ${MK_SOURCELESS_UCODE} != "no"
843 _sgx_linux= sgx_linux
848 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
849 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
850 .if ${KERN_OPTS:MSMP}
856 .if ${MACHINE_CPUARCH} == "i386"
857 # XXX some of these can move to the general case when de-i386'ed
858 # XXX some of these can move now, but are untested on other architectures.
860 _3dfx_linux= 3dfx_linux
868 .if ${MACHINE_ARCH} == "armv7"
873 .if ${MACHINE_CPUARCH} == "powerpc"
887 .if ${MACHINE_ARCH:Mpowerpc64*} != ""
892 .if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
893 # Don't build powermac_nvram for powerpcspe, it's never supported.
894 _nvram+= powermac_nvram
897 .if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
898 _bcm283x_clkman= bcm283x_clkman
899 _bcm283x_pwm= bcm283x_pwm
902 .if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
903 # LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
904 # https://bugs.llvm.org/show_bug.cgi?id=44351
908 SUBDIR+=${MODULES_EXTRA}
910 .for reject in ${WITHOUT_MODULES}
911 SUBDIR:= ${SUBDIR:N${reject}}
914 .endif # MODULES_OVERRIDE -- Keep last
916 # Calling kldxref(8) for each module is expensive.
917 .if !defined(NO_XREF)
918 .MAKEFLAGS+= -DNO_XREF
920 ${KLDXREF_CMD} ${DESTDIR}${KMODDIR}
921 .if defined(NO_ROOT) && defined(METALOG)
922 echo ".${DISTBASE}${KMODDIR}/linker.hints type=file mode=0644 uname=root gname=wheel" | \
927 SUBDIR:= ${SUBDIR:u:O}
929 .include <bsd.subdir.mk>