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 .if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
12 SUBDIR=${MODULES_OVERRIDE}
87 ${_chromebook_platform} \
421 .if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
425 .if ${MK_CDDL} != "no" || defined(ALL_MODULES)
426 .if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv[67]*} != "") && \
427 ${MACHINE_CPUARCH} != "mips" && \
428 ${MACHINE_CPUARCH} != "sparc64"
434 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
435 .if exists(${SRCTOP}/sys/opencrypto)
437 _cryptodev= cryptodev
438 _random_fortuna=random_fortuna
439 _random_yarrow= random_yarrow
440 _random_other= random_other
444 .if ${MK_CUSE} != "no" || defined(ALL_MODULES)
448 .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
455 _ipfw_pmod= ipfw_pmod
456 .if ${MK_IPSEC_SUPPORT} != "no"
461 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
466 .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
470 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
471 _ipfw_nat64= ipfw_nat64
475 .if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
476 _ipfw_nptv6= ipfw_nptv6
479 .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
483 .if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
486 SUBDIR+= iscsi_initiator
489 .if ${MK_NAND} != "no" || defined(ALL_MODULES)
494 .if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
498 .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
499 ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
502 .if ${MK_INET_SUPPORT} != "no"
507 .if ${MK_SOURCELESS_UCODE} != "no"
515 .if ${MACHINE_CPUARCH} != "mips"
523 .if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
524 ${MACHINE_CPUARCH} != "mips" && \
525 ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
526 ${MACHINE_CPUARCH} != "riscv"
530 .if ${MK_TESTS} != "no" || defined(ALL_MODULES)
534 .if ${MK_ZFS} != "no" || defined(ALL_MODULES)
538 .if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
539 _hwpmc_mips24k= hwpmc_mips24k
540 _hwpmc_mips74k= hwpmc_mips74k
543 .if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
544 ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
545 ${MACHINE_CPUARCH} != "riscv"
550 .if ${MACHINE_CPUARCH} != "mips"
551 # no BUS_SPACE_UNSPECIFIED
552 # No barrier instruction support (specific to this driver)
554 # intr_disable() is a macro, causes problems
555 .if ${MK_SOURCELESS_UCODE} != "no"
560 .if ${MACHINE_CPUARCH} == "aarch64"
561 _armv8crypto= armv8crypto
566 .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
572 .if ${MK_SOURCELESS_UCODE} != "no"
590 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
595 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
601 _linprocfs= linprocfs
604 .if ${MK_SOURCELESS_UCODE} != "no"
610 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
627 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
630 _amd_ecc_inject=amd_ecc_inject
638 _chromebook_platform= chromebook_platform
641 .if ${MK_SOURCELESS_HOST} != "no"
645 .if ${MK_SOURCELESS_HOST} != "no"
663 .if ${MK_SOURCELESS_UCODE} != "no"
671 .if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
676 .if ${MK_OFED} != "no" || defined(ALL_MODULES)
686 .if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
688 _padlock_rng= padlock_rng
689 _rdrand_rng= rdrand_rng
692 _sdhci_acpi= sdhci_acpi
699 .if ${MK_SOURCELESS_UCODE} != "no"
705 .if ${MACHINE_CPUARCH} == "amd64"
711 _linux_common= linux_common
716 .if ${MK_SOURCELESS_UCODE} != "no"
722 _sgx_linux= sgx_linux
724 .if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
729 .if ${MACHINE_CPUARCH} == "i386"
730 # XXX some of these can move to the general case when de-i386'ed
731 # XXX some of these can move now, but are untested on other architectures.
733 _3dfx_linux= 3dfx_linux
737 .if ${MK_SOURCELESS_UCODE} != "no"
741 .if ${MK_SOURCELESS_UCODE} != "no"
756 .if ${MK_SOURCELESS_UCODE} != "no"
763 .if ${MACHINE_CPUARCH} == "arm"
768 .if ${MACHINE_CPUARCH} == "powerpc"
783 .if ${MACHINE_ARCH} == "powerpc64"
786 .if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
787 # Don't build powermac_nvram for powerpcspe, it's never supported.
788 _nvram= powermac_nvram
791 .if ${MACHINE_CPUARCH} == "sparc64"
797 .if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
798 ${MACHINE_ARCH:Marmv[67]*} != "" || ${MACHINE_CPUARCH} == "i386")
799 _cloudabi32= cloudabi32
801 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
802 _cloudabi64= cloudabi64
807 .if ${MACHINE_ARCH:Marmv[67]*} != ""
811 SUBDIR+=${MODULES_EXTRA}
813 .for reject in ${WITHOUT_MODULES}
814 SUBDIR:= ${SUBDIR:N${reject}}
817 # Calling kldxref(8) for each module is expensive.
818 .if !defined(NO_XREF)
819 .MAKEFLAGS+= -DNO_XREF
821 @if type kldxref >/dev/null 2>&1; then \
822 ${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
823 kldxref ${DESTDIR}${KMODDIR}; \
827 .include "${SYSDIR}/conf/config.mk"
829 SUBDIR:= ${SUBDIR:u:O}
831 .include <bsd.subdir.mk>