xref: /freebsd/sys/modules/Makefile (revision af0a81b6470aba4af4a24ae9804053722846ded4)
1SYSDIR?=${SRCTOP}/sys
2.include "${SYSDIR}/conf/kern.opts.mk"
3
4SUBDIR_PARALLEL=
5
6# Modules that include binary-only blobs of microcode should be selectable by
7# MK_SOURCELESS_UCODE option (see below).
8
9.include "${SYSDIR}/conf/config.mk"
10
11.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
12SUBDIR=${MODULES_OVERRIDE}
13.else
14SUBDIR=	\
15	${_3dfx} \
16	${_3dfx_linux} \
17	${_aac} \
18	${_aacraid} \
19	accf_data \
20	accf_dns \
21	accf_http \
22	accf_tls \
23	acl_nfs4 \
24	acl_posix1e \
25	${_acpi} \
26	ae \
27	${_aesni} \
28	age \
29	${_agp} \
30	ahci \
31	aic7xxx \
32	alc \
33	ale \
34	alq \
35	${_amd_ecc_inject} \
36	${_amdgpio} \
37	${_amdsbwd} \
38	${_amdsmn} \
39	${_amdtemp} \
40	${_aout} \
41	${_arcmsr} \
42	${_allwinner} \
43	${_armv8crypto} \
44	${_armv8_rng} \
45	${_asmc} \
46	ata \
47	ath \
48	ath_dfs \
49	ath_hal \
50	ath_hal_ar5210 \
51	ath_hal_ar5211 \
52	ath_hal_ar5212 \
53	ath_hal_ar5416 \
54	ath_hal_ar9300 \
55	ath_main \
56	ath_rate \
57	${_autofs} \
58	axgbe \
59	backlight \
60	${_bce} \
61	${_bcm283x_clkman} \
62	${_bcm283x_pwm} \
63	bfe \
64	bge \
65	bhnd \
66	${_bxe} \
67	${_bios} \
68	${_blake2} \
69	${_bnxt} \
70	bridgestp \
71	bwi \
72	bwn \
73	${_bytgpio} \
74	${_chvgpio} \
75	cam \
76	${_cardbus} \
77	${_carp} \
78	cas \
79	${_cbb} \
80	cc \
81	${_ccp} \
82	cd9660 \
83	cd9660_iconv \
84	${_cfi} \
85	${_chromebook_platform} \
86	${_ciss} \
87	${_coretemp} \
88	${_cpsw} \
89	${_cpuctl} \
90	${_cpufreq} \
91	${_crypto} \
92	${_cryptodev} \
93	ctl \
94	${_cxgb} \
95	${_cxgbe} \
96	dc \
97	dcons \
98	dcons_crom \
99	${_dpaa2} \
100	${_dpdk_lpm4} \
101	${_dpdk_lpm6} \
102	${_dpms} \
103	dummymbuf \
104	dummynet \
105	${_dwwdt} \
106	${_e6000sw} \
107	${_efirt} \
108	${_em} \
109	${_ena} \
110	${_enic} \
111	${_enetc} \
112	${_et} \
113	evdev \
114	${_exca} \
115	ext2fs \
116	fdc \
117	fdescfs \
118	${_felix} \
119	${_ffec} \
120	${_fib_dxr} \
121	filemon \
122	firewire \
123	firmware \
124	flash \
125	${_ftgpio} \
126	${_ftwd} \
127	fusefs \
128	${_fxp} \
129	gem \
130	geom \
131	${_glxiic} \
132	${_glxsb} \
133	gpio \
134	${_gve} \
135	hid \
136	hifn \
137	${_hpt27xx} \
138	${_hptiop} \
139	${_hptmv} \
140	${_hptnr} \
141	${_hptrr} \
142	hwpmc \
143	${_hyperv} \
144	i2c \
145	${_iavf} \
146        ${_ibcore} \
147	${_ichwd} \
148	${_ice} \
149	${_ice_ddp} \
150	${_irdma} \
151	${_ida} \
152	if_bridge \
153	${_if_cgem} \
154	if_disc \
155	if_edsc \
156	${_if_enc} \
157	if_epair \
158	${_genet} \
159	${_if_gif} \
160	${_if_gre} \
161	${_if_me} \
162	if_infiniband \
163	if_lagg \
164	if_ovpn \
165	${_if_stf} \
166	if_tuntap \
167	if_vlan \
168	if_vxlan \
169	${_if_wg} \
170	iflib \
171	${_igc} \
172	imgact_binmisc \
173	${_intelspi} \
174	${_io} \
175	${_ioat} \
176        ${_ipoib} \
177	ipdivert \
178	${_ipfilter} \
179	${_ipfw} \
180	ipfw_nat \
181	${_ipfw_nat64} \
182	${_ipfw_nptv6} \
183	${_ipfw_pmod} \
184	${_ipmi} \
185	ip6_mroute_mod \
186	ip_mroute_mod \
187	${_ips} \
188	${_ipsec} \
189	${_ipw} \
190	${_ipwfw} \
191	${_isci} \
192	${_iser} \
193	isp \
194	${_ispfw} \
195	${_itwd} \
196	${_iwi} \
197	${_iwifw} \
198	${_iwlwifi} \
199	${_iwlwififw} \
200	${_iwm} \
201	${_iwn} \
202	${_iwnfw} \
203	${_ix} \
204	${_ixv} \
205	${_ixl} \
206	jme \
207	kbdmux \
208	kgssapi \
209	kgssapi_krb5 \
210	khelp \
211	krpc \
212	ksyms \
213	le \
214	lge \
215	libalias \
216	libiconv \
217	libmchain \
218	lindebugfs \
219	linuxkpi \
220	linuxkpi_hdmi \
221	linuxkpi_video \
222	linuxkpi_wlan \
223	${_lio} \
224	lpt \
225	${_mac_biba} \
226	${_mac_bsdextended} \
227	${_mac_ddb} \
228	${_mac_do} \
229	${_mac_ifoff} \
230	${_mac_ipacl} \
231	${_mac_lomac} \
232	${_mac_mls} \
233	${_mac_none} \
234	${_mac_ntpd} \
235	${_mac_partition} \
236	${_mac_pimd} \
237	${_mac_portacl} \
238	${_mac_priority} \
239	${_mac_seeotheruids} \
240	${_mac_stub} \
241	${_mac_test} \
242	${_mac_veriexec} \
243	${_mac_veriexec_sha1} \
244	${_mac_veriexec_sha256} \
245	${_mac_veriexec_sha384} \
246	${_mac_veriexec_sha512} \
247	${_malo} \
248	${_mana} \
249	md \
250	mdio \
251	${_mgb} \
252	mem \
253	mfi \
254	mii \
255	mlx \
256	mlxfw \
257	${_mlx4} \
258	${_mlx4ib} \
259	${_mlx4en} \
260	${_mlx5} \
261	${_mlx5en} \
262	${_mlx5ib} \
263	mmc \
264	mmcsd \
265	${_mpi3mr} \
266	${_mpr} \
267	${_mps} \
268	mpt \
269	mqueue \
270	mrsas \
271	msdosfs \
272	msdosfs_iconv \
273	msk \
274	${_mthca} \
275	mvs \
276	mwl \
277	${_mwlfw} \
278	mxge \
279	my \
280	${_nctgpio} \
281	${_ncthwm} \
282	${_neta} \
283	netlink \
284	${_netgraph} \
285	${_nfe} \
286	nfscl \
287	nfscommon \
288	nfsd \
289	nfslockd \
290	nfssvc \
291	nlsysevent \
292	nge \
293	nmdm \
294	nullfs \
295	${_ntb} \
296	nvd \
297	${_nvdimm} \
298	nvme \
299	nvmf \
300	${_nvram} \
301	oce \
302	${_ocs_fc} \
303	${_ossl} \
304	otus \
305	${_otusfw} \
306	ow \
307	p9fs \
308	${_padlock} \
309	${_padlock_rng} \
310	${_pchtherm} \
311	${_pcfclock} \
312	${_pf} \
313	${_pflog} \
314	${_pflow} \
315	${_pfsync} \
316	plip \
317	${_pms} \
318	ppbus \
319	ppc \
320	ppi \
321	pps \
322	procfs \
323	proto \
324	pseudofs \
325	${_pst} \
326	pty  \
327	puc \
328	pwm \
329	${_qat} \
330	${_qatfw} \
331	${_qat_c2xxx} \
332	${_qat_c2xxxfw} \
333	${_qlxge} \
334	${_qlxgb} \
335	${_qlxgbe} \
336	${_qlnx} \
337	ral \
338	${_ralfw} \
339	${_random_fortuna} \
340	${_random_other} \
341	rc4 \
342	${_rdma} \
343	${_rdrand_rng} \
344	re \
345	rl \
346	${_rockchip} \
347	rtsx \
348	${_rtw88} \
349	${_rtw89} \
350	rtwn \
351	rtwn_pci \
352	rtwn_usb \
353	${_rtwnfw} \
354	${_s3} \
355	${_safe} \
356	safexcel \
357	${_sbni} \
358	scc \
359	${_sctp} \
360	sdhci \
361	${_sdhci_acpi} \
362	${_sdhci_fdt} \
363	sdhci_pci \
364	sdio \
365	${_sff} \
366	sem \
367	send \
368	${_sfxge} \
369	sge \
370	${_sgx} \
371	${_sgx_linux} \
372	siftr \
373	siis \
374	sis \
375	sk \
376	${_smartpqi} \
377	smbfs \
378	snp \
379	sound \
380	${_speaker} \
381	spi \
382	${_splash} \
383	ste \
384	stge \
385	${_sume} \
386	${_superio} \
387	${_p2sb} \
388	sym \
389	${_syscons} \
390	sysvipc \
391	tarfs \
392	tcp \
393	${_ti} \
394	tmpfs \
395	${_toecore} \
396	tpm \
397	tws \
398	uart \
399	udf \
400	udf_iconv \
401	ufs \
402	uinput \
403	unionfs \
404	usb \
405	${_vesa} \
406	${_vf_i2c} \
407	virtio \
408	vge \
409	${_viawd} \
410	videomode \
411	vkbd \
412	${_vmd} \
413	${_vmm} \
414	${_vmware} \
415	vr \
416	vte \
417	${_wbwd} \
418	${_wdatwd} \
419	wlan \
420	wlan_acl \
421	wlan_amrr \
422	wlan_ccmp \
423	wlan_rssadapt \
424	wlan_tkip \
425	wlan_wep \
426	wlan_xauth \
427	${_wpi} \
428	${_wpifw} \
429	${_x86bios} \
430	xdr \
431	xl \
432	xz \
433	zlib
434
435.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
436_autofs=	autofs
437.endif
438
439.if ${MK_DTRACE} != "no" || defined(ALL_MODULES)
440.if ${KERN_OPTS:MKDTRACE_HOOKS}
441SUBDIR+=	dtrace
442.endif
443SUBDIR+=	opensolaris
444.endif
445
446.if !${MACHINE_ABI:Mlong32}
447_bnxt=		bnxt
448.endif
449
450.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
451.if exists(${SRCTOP}/sys/opencrypto)
452_crypto=	crypto
453_cryptodev=	cryptodev
454_random_fortuna=random_fortuna
455_random_other=	random_other
456.endif
457.endif
458
459.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
460SUBDIR+=	cuse
461.endif
462
463.if ${MK_EFI} != "no"
464.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
465_efirt=		efirt
466.endif
467.endif
468
469.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
470	defined(ALL_MODULES)
471_carp=		carp
472_toecore=	toecore
473_if_enc=	if_enc
474_if_gif=	if_gif
475_if_gre=	if_gre
476.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
477_if_wg=		if_wg
478.endif
479_ipfw_pmod=	ipfw_pmod
480.if ${KERN_OPTS:MIPSEC_SUPPORT} && !${KERN_OPTS:MIPSEC}
481_ipsec=		ipsec
482.endif
483.if ${KERN_OPTS:MSCTP_SUPPORT} || ${KERN_OPTS:MSCTP}
484_sctp=		sctp
485.endif
486.endif
487
488.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
489	defined(ALL_MODULES)
490_if_stf=	if_stf
491.endif
492
493.if (${KERN_OPTS:MINET} && ${MK_INET_SUPPORT} != "no") || defined(ALL_MODULES)
494_if_me=		if_me
495_ipfw=		ipfw
496.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
497_ipfw_nat64=	ipfw_nat64
498.endif
499.endif
500
501.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
502_ipfw_nptv6=	ipfw_nptv6
503.endif
504
505.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
506_ipfilter=	ipfilter
507.endif
508
509.if ${MK_INET_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO} && ${KERN_OPTS:MINET}
510_dpdk_lpm4=	dpdk_lpm4
511_fib_dxr=	fib_dxr
512.endif
513
514.if ${MK_INET6_SUPPORT} != "no" && ${KERN_OPTS:MFIB_ALGO}
515_dpdk_lpm6=	dpdk_lpm6
516.endif
517
518.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
519SUBDIR+=	cfiscsi
520SUBDIR+=	iscsi
521.endif
522
523.if !empty(OPT_FDT)
524SUBDIR+=	fdt
525.endif
526
527# Linuxulator
528.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
529    ${MACHINE_CPUARCH} == "i386"
530SUBDIR+=	linprocfs
531SUBDIR+=	linsysfs
532.endif
533.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
534SUBDIR+=	linux
535.endif
536.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
537SUBDIR+=	linux64
538SUBDIR+=	linux_common
539.endif
540
541.if ${MACHINE_CPUARCH} != "arm"
542.if ${MK_OFED} != "no" || defined(ALL_MODULES)
543_ibcore=	ibcore
544_ipoib=		ipoib
545_iser=		iser
546_mthca=		mthca
547_rdma=		rdma
548.endif
549.endif
550
551.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
552    ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH:Mpowerpc64*} != ""
553_ipmi=		ipmi
554_mlx4=		mlx4
555_mlx5=		mlx5
556.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
557	defined(ALL_MODULES)
558_mlx4en=	mlx4en
559_mlx5en=	mlx5en
560.endif
561.if ${MK_OFED} != "no" || defined(ALL_MODULES)
562_mlx4ib=	mlx4ib
563_mlx5ib=	mlx5ib
564.endif
565.endif
566
567.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
568    ${MACHINE_CPUARCH} == "i386"
569_ena=		ena
570_gve=		gve
571_iwlwifi=	iwlwifi
572.if ${MK_SOURCELESS_UCODE} != "no"
573_iwlwififw=	iwlwififw
574.endif
575_rtw88=		rtw88
576_rtw89=		rtw89
577_vmware=	vmware
578.endif
579
580.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
581    ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH} == "armv7" || \
582	${MACHINE_ARCH:Mpowerpc64*} != ""
583_ossl=		ossl
584.endif
585
586# MAC framework
587.if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
588_mac_biba=	mac_biba
589_mac_bsdextended= mac_bsdextended
590.if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
591_mac_ddb=	mac_ddb
592.endif
593_mac_do=	mac_do
594_mac_ifoff=	mac_ifoff
595_mac_ipacl=	mac_ipacl
596_mac_lomac=	mac_lomac
597_mac_mls=	mac_mls
598_mac_none=	mac_none
599_mac_ntpd=	mac_ntpd
600_mac_partition=	mac_partition
601_mac_pimd=	mac_pimd
602_mac_portacl=	mac_portacl
603_mac_priority=	mac_priority
604_mac_seeotheruids= mac_seeotheruids
605_mac_stub=	mac_stub
606_mac_test=	mac_test
607.if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
608_mac_veriexec=	mac_veriexec
609_mac_veriexec_sha1= mac_veriexec_sha1
610_mac_veriexec_sha256= mac_veriexec_sha256
611_mac_veriexec_sha384= mac_veriexec_sha384
612_mac_veriexec_sha512= mac_veriexec_sha512
613.endif
614.endif
615
616.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
617_netgraph=	netgraph
618.endif
619
620.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
621	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
622_pf=		pf
623_pflog=		pflog
624_pflow=		pflow
625.if ${MK_INET_SUPPORT} != "no"
626_pfsync=	pfsync
627.endif
628.endif
629
630.if ${MK_SOURCELESS_UCODE} != "no"
631_bce=		bce
632_fxp=		fxp
633_ispfw=		ispfw
634_ti=		ti
635_mwlfw=		mwlfw
636_otusfw=	otusfw
637_ralfw=		ralfw
638_rtwnfw=	rtwnfw
639.endif
640
641.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
642	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
643	${MACHINE_CPUARCH} != "riscv"
644_cxgbe=		cxgbe
645.endif
646
647# This has only been tested on amd64 and arm64
648.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
649_mpi3mr=mpi3mr
650.endif
651
652# Specific to the Raspberry Pi.
653.if ${MACHINE_CPUARCH} == "aarch64"
654_genet=		genet
655.endif
656
657.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
658	${MACHINE_ARCH:Mpowerpc64*}
659_ice=		ice
660.if ${MK_SOURCELESS_UCODE} != "no"
661_ice_ddp=	ice_ddp
662.endif
663.if ${MK_OFED} != "no" || defined(ALL_MODULES)
664.if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
665_irdma=		irdma
666.endif
667.endif
668.endif
669
670.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
671	${MACHINE_CPUARCH} == "riscv"
672.if !empty(OPT_FDT)
673_if_cgem=	if_cgem
674.endif
675.endif
676
677# These rely on 64bit atomics
678.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
679_mps=		mps
680_mpr=		mpr
681.endif
682
683.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
684SUBDIR+=	ktest
685SUBDIR+=	tests
686.endif
687
688.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
689SUBDIR+=	zfs
690.endif
691
692.if ${MK_SOURCELESS_UCODE} != "no"
693_cxgb=		cxgb
694.endif
695
696.if ${MACHINE_CPUARCH} == "aarch64"
697_armv8crypto=	armv8crypto
698_armv8_rng=	armv8_rng
699_dpaa2=		dpaa2
700_sff=		sff
701_em=		em
702_hyperv=  hyperv
703_vf_i2c=	vf_i2c
704
705.if !empty(OPT_FDT)
706_allwinner=	allwinner
707_dwwdt=		dwwdt
708_enetc=		enetc
709_felix=		felix
710_rockchip=	rockchip
711.endif
712.endif
713
714.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
715.if !empty(OPT_FDT)
716_sdhci_fdt=	sdhci_fdt
717.endif
718_e6000sw=	e6000sw
719_neta=		neta
720.endif
721
722.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
723_agp=		agp
724.if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
725_aout=		aout
726.endif
727_bios=		bios
728.if ${MK_SOURCELESS_UCODE} != "no"
729_bxe=		bxe
730.endif
731_cardbus=	cardbus
732_cbb=		cbb
733_cpuctl=	cpuctl
734_cpufreq=	cpufreq
735_dpms=		dpms
736_em=		em
737_et=		et
738_ftgpio=	ftgpio
739_ftwd=		ftwd
740_exca=		exca
741_igc=		igc
742_io=		io
743_itwd=		itwd
744_ix=		ix
745_ixv=		ixv
746.if ${MK_SOURCELESS_UCODE} != "no"
747_lio=		lio
748.endif
749_mana=		mana
750_mgb=		mgb
751_nctgpio=	nctgpio
752_ncthwm=	ncthwm
753_ntb=		ntb
754_ocs_fc=	ocs_fc
755_p2sb=		p2sb
756_qat_c2xxx=	qat_c2xxx
757_qat_c2xxxfw=	qat_c2xxxfw
758_safe=		safe
759_speaker=	speaker
760_splash=	splash
761_syscons=	syscons
762_wbwd=		wbwd
763_wdatwd=	wdatwd
764
765_aac=		aac
766_aacraid=	aacraid
767_acpi=		acpi
768.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
769_aesni=		aesni
770.endif
771_amd_ecc_inject=amd_ecc_inject
772_amdsbwd=	amdsbwd
773_amdsmn=	amdsmn
774_amdtemp=	amdtemp
775_arcmsr=	arcmsr
776_asmc=		asmc
777.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
778_blake2=	blake2
779.endif
780_bytgpio=	bytgpio
781_chvgpio=	chvgpio
782_ciss=		ciss
783_chromebook_platform=	chromebook_platform
784_coretemp=	coretemp
785.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
786_hpt27xx=	hpt27xx
787.endif
788_hptiop=	hptiop
789.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
790_hptmv=		hptmv
791_hptnr=		hptnr
792_hptrr=		hptrr
793.endif
794_hyperv=	hyperv
795_ichwd=		ichwd
796_ida=		ida
797_intelspi=	intelspi
798_ips=		ips
799_isci=		isci
800_ipw=		ipw
801_iwi=		iwi
802_iwm=		iwm
803_iwn=		iwn
804.if ${MK_SOURCELESS_UCODE} != "no"
805_ipwfw=		ipwfw
806_iwifw=		iwifw
807_iwnfw=		iwnfw
808.endif
809_nfe=		nfe
810_nvram=		nvram
811.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
812_padlock=	padlock
813_padlock_rng=	padlock_rng
814_rdrand_rng=	rdrand_rng
815.endif
816_pchtherm = pchtherm
817_s3=		s3
818_sdhci_acpi=	sdhci_acpi
819_superio=	superio
820_vesa=		vesa
821_viawd=		viawd
822_vmd=		vmd
823_wpi=		wpi
824.if ${MK_SOURCELESS_UCODE} != "no"
825_wpifw=		wpifw
826.endif
827_x86bios=	x86bios
828.endif
829
830.if ${MACHINE_CPUARCH} == "amd64"
831_amdgpio=	amdgpio
832_ccp=		ccp
833_enic=		enic
834_iavf=		iavf
835_ioat=		ioat
836_ixl=		ixl
837_nvdimm=	nvdimm
838_pms=		pms
839_qat=		qat
840.if ${MK_SOURCELESS_UCODE} != "no"
841_qatfw=		qatfw
842.endif
843_qlxge=		qlxge
844_qlxgb=		qlxgb
845_sume=		sume
846.if ${MK_SOURCELESS_UCODE} != "no"
847_qlxgbe=	qlxgbe
848_qlnx=		qlnx
849.endif
850_sfxge=		sfxge
851_sgx=		sgx
852_sgx_linux=	sgx_linux
853_smartpqi=	smartpqi
854_p2sb=		p2sb
855.endif
856
857.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
858    ${MACHINE_CPUARCH} == "riscv"
859.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
860.if ${KERN_OPTS:MSMP}
861_vmm=		vmm
862.endif
863.endif
864.endif
865
866.if ${MACHINE_CPUARCH} == "i386"
867# XXX some of these can move to the general case when de-i386'ed
868# XXX some of these can move now, but are untested on other architectures.
869_3dfx=		3dfx
870_3dfx_linux=	3dfx_linux
871_glxiic=	glxiic
872_glxsb=		glxsb
873_pcfclock=	pcfclock
874_pst=		pst
875_sbni=		sbni
876.endif
877
878.if ${MACHINE_ARCH} == "armv7"
879_cfi=		cfi
880_cpsw=		cpsw
881.endif
882
883.if ${MACHINE_CPUARCH} == "powerpc"
884_aacraid=	aacraid
885_agp=		agp
886_an=		an
887_cardbus=	cardbus
888_cbb=		cbb
889_cfi=		cfi
890_cpufreq=	cpufreq
891_exca=		exca
892_ffec=		ffec
893.endif
894
895.if ${MACHINE_ARCH:Mpowerpc64*} != ""
896_ixl=		ixl
897_nvram=		opal_nvram
898.endif
899
900.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
901# Don't build powermac_nvram for powerpcspe, it's never supported.
902_nvram+=	powermac_nvram
903.endif
904
905.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
906_bcm283x_clkman=  bcm283x_clkman
907_bcm283x_pwm=  bcm283x_pwm
908.endif
909
910.if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
911# LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
912# https://bugs.llvm.org/show_bug.cgi?id=44351
913_malo=	malo
914.endif
915
916SUBDIR+=${MODULES_EXTRA}
917
918.for reject in ${WITHOUT_MODULES}
919SUBDIR:= ${SUBDIR:N${reject}}
920.endfor
921
922.endif # MODULES_OVERRIDE -- Keep last
923
924# Calling kldxref(8) for each module is expensive.
925.if !defined(NO_XREF)
926.MAKEFLAGS+=	-DNO_XREF
927afterinstall: .PHONY
928	${KLDXREF_CMD} ${DESTDIR}${KMODDIR}
929.if defined(NO_ROOT) && defined(METALOG)
930	echo ".${DISTBASE}${KMODDIR}/linker.hints type=file mode=0644 uname=root gname=wheel" | \
931	    cat -l >> ${METALOG}
932.endif
933.endif
934
935SUBDIR:= ${SUBDIR:u:O}
936
937.include <bsd.subdir.mk>
938