xref: /freebsd/sys/modules/Makefile (revision 4f351c1ddcfbd74a93e9969ab7b99f09e785de55)
1
2SYSDIR?=${SRCTOP}/sys
3.include "${SYSDIR}/conf/kern.opts.mk"
4
5SUBDIR_PARALLEL=
6
7# Modules that include binary-only blobs of microcode should be selectable by
8# MK_SOURCELESS_UCODE option (see below).
9
10.include "${SYSDIR}/conf/config.mk"
11
12.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
13SUBDIR=${MODULES_OVERRIDE}
14.else
15SUBDIR=	\
16	${_3dfx} \
17	${_3dfx_linux} \
18	${_aac} \
19	${_aacraid} \
20	accf_data \
21	accf_dns \
22	accf_http \
23	accf_tls \
24	acl_nfs4 \
25	acl_posix1e \
26	${_acpi} \
27	ae \
28	${_aesni} \
29	age \
30	${_agp} \
31	ahci \
32	aic7xxx \
33	alc \
34	ale \
35	alq \
36	${_amd_ecc_inject} \
37	${_amdgpio} \
38	${_amdsbwd} \
39	${_amdsmn} \
40	${_amdtemp} \
41	${_aout} \
42	${_arcmsr} \
43	${_allwinner} \
44	${_armv8crypto} \
45	${_armv8_rng} \
46	${_asmc} \
47	ata \
48	ath \
49	ath_dfs \
50	ath_hal \
51	ath_hal_ar5210 \
52	ath_hal_ar5211 \
53	ath_hal_ar5212 \
54	ath_hal_ar5416 \
55	ath_hal_ar9300 \
56	ath_main \
57	ath_rate \
58	${_autofs} \
59	axgbe \
60	backlight \
61	${_bce} \
62	${_bcm283x_clkman} \
63	${_bcm283x_pwm} \
64	bfe \
65	bge \
66	bhnd \
67	${_bxe} \
68	${_bios} \
69	${_blake2} \
70	${_bnxt} \
71	bridgestp \
72	bwi \
73	bwn \
74	${_bytgpio} \
75	${_chvgpio} \
76	cam \
77	${_cardbus} \
78	${_carp} \
79	cas \
80	${_cbb} \
81	cc \
82	${_ccp} \
83	cd9660 \
84	cd9660_iconv \
85	${_cfi} \
86	${_chromebook_platform} \
87	${_ciss} \
88	${_coretemp} \
89	${_cpsw} \
90	${_cpuctl} \
91	${_cpufreq} \
92	${_crypto} \
93	${_cryptodev} \
94	ctl \
95	${_cxgb} \
96	${_cxgbe} \
97	dc \
98	dcons \
99	dcons_crom \
100	${_dpaa2} \
101	${_dpdk_lpm4} \
102	${_dpdk_lpm6} \
103	${_dpms} \
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	${_iwmfw} \
202	${_iwn} \
203	${_iwnfw} \
204	${_ix} \
205	${_ixv} \
206	${_ixl} \
207	jme \
208	kbdmux \
209	kgssapi \
210	kgssapi_krb5 \
211	khelp \
212	krpc \
213	ksyms \
214	le \
215	lge \
216	libalias \
217	libiconv \
218	libmchain \
219	lindebugfs \
220	linuxkpi \
221	linuxkpi_hdmi \
222	linuxkpi_video \
223	linuxkpi_wlan \
224	${_lio} \
225	lpt \
226	${_mac_biba} \
227	${_mac_bsdextended} \
228	${_mac_ddb} \
229	${_mac_do} \
230	${_mac_ifoff} \
231	${_mac_ipacl} \
232	${_mac_lomac} \
233	${_mac_mls} \
234	${_mac_none} \
235	${_mac_ntpd} \
236	${_mac_partition} \
237	${_mac_pimd} \
238	${_mac_portacl} \
239	${_mac_priority} \
240	${_mac_seeotheruids} \
241	${_mac_stub} \
242	${_mac_test} \
243	${_mac_veriexec} \
244	${_mac_veriexec_sha1} \
245	${_mac_veriexec_sha256} \
246	${_mac_veriexec_sha384} \
247	${_mac_veriexec_sha512} \
248	${_malo} \
249	${_mana} \
250	md \
251	mdio \
252	${_mgb} \
253	mem \
254	mfi \
255	mii \
256	mlx \
257	mlxfw \
258	${_mlx4} \
259	${_mlx4ib} \
260	${_mlx4en} \
261	${_mlx5} \
262	${_mlx5en} \
263	${_mlx5ib} \
264	mmc \
265	mmcsd \
266	${_mpi3mr} \
267	${_mpr} \
268	${_mps} \
269	mpt \
270	mqueue \
271	mrsas \
272	msdosfs \
273	msdosfs_iconv \
274	msk \
275	${_mthca} \
276	mvs \
277	mwl \
278	${_mwlfw} \
279	mxge \
280	my \
281	${_nctgpio} \
282	${_ncthwm} \
283	${_neta} \
284	netlink \
285	${_netgraph} \
286	${_nfe} \
287	nfscl \
288	nfscommon \
289	nfsd \
290	nfslockd \
291	nfssvc \
292	nlsysevent \
293	nge \
294	nmdm \
295	nullfs \
296	${_ntb} \
297	nvd \
298	${_nvdimm} \
299	nvme \
300	nvmf \
301	${_nvram} \
302	oce \
303	${_ocs_fc} \
304	${_ossl} \
305	otus \
306	${_otusfw} \
307	ow \
308	p9fs \
309	${_padlock} \
310	${_padlock_rng} \
311	${_pchtherm} \
312	${_pcfclock} \
313	${_pf} \
314	${_pflog} \
315	${_pflow} \
316	${_pfsync} \
317	plip \
318	${_pms} \
319	ppbus \
320	ppc \
321	ppi \
322	pps \
323	procfs \
324	proto \
325	pseudofs \
326	${_pst} \
327	pty  \
328	puc \
329	pwm \
330	${_qat} \
331	${_qatfw} \
332	${_qat_c2xxx} \
333	${_qat_c2xxxfw} \
334	${_qlxge} \
335	${_qlxgb} \
336	${_qlxgbe} \
337	${_qlnx} \
338	ral \
339	${_ralfw} \
340	${_random_fortuna} \
341	${_random_other} \
342	rc4 \
343	${_rdma} \
344	${_rdrand_rng} \
345	re \
346	rl \
347	${_rockchip} \
348	rtsx \
349	${_rtw88} \
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_vmware=	vmware
577.endif
578
579.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
580    ${MACHINE_CPUARCH} == "i386" || ${MACHINE_ARCH} == "armv7"
581_ossl=		ossl
582.endif
583
584# MAC framework
585.if ${KERN_OPTS:MMAC} || defined(ALL_MODULES)
586_mac_biba=	mac_biba
587_mac_bsdextended= mac_bsdextended
588.if ${KERN_OPTS:MDDB} || defined(ALL_MODULES)
589_mac_ddb=	mac_ddb
590.endif
591_mac_do=	mac_do
592_mac_ifoff=	mac_ifoff
593_mac_ipacl=	mac_ipacl
594_mac_lomac=	mac_lomac
595_mac_mls=	mac_mls
596_mac_none=	mac_none
597_mac_ntpd=	mac_ntpd
598_mac_partition=	mac_partition
599_mac_pimd=	mac_pimd
600_mac_portacl=	mac_portacl
601_mac_priority=	mac_priority
602_mac_seeotheruids= mac_seeotheruids
603_mac_stub=	mac_stub
604_mac_test=	mac_test
605.if ${MK_VERIEXEC} != "no" || defined(ALL_MODULES)
606_mac_veriexec=	mac_veriexec
607_mac_veriexec_sha1= mac_veriexec_sha1
608_mac_veriexec_sha256= mac_veriexec_sha256
609_mac_veriexec_sha384= mac_veriexec_sha384
610_mac_veriexec_sha512= mac_veriexec_sha512
611.endif
612.endif
613
614.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
615_netgraph=	netgraph
616.endif
617
618.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
619	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
620_pf=		pf
621_pflog=		pflog
622_pflow=		pflow
623.if ${MK_INET_SUPPORT} != "no"
624_pfsync=	pfsync
625.endif
626.endif
627
628.if ${MK_SOURCELESS_UCODE} != "no"
629_bce=		bce
630_fxp=		fxp
631_ispfw=		ispfw
632_ti=		ti
633_mwlfw=		mwlfw
634_otusfw=	otusfw
635_ralfw=		ralfw
636_rtwnfw=	rtwnfw
637.endif
638
639.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
640	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
641	${MACHINE_CPUARCH} != "riscv"
642_cxgbe=		cxgbe
643.endif
644
645# This has only been tested on amd64 and arm64
646.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64"
647_mpi3mr=mpi3mr
648.endif
649
650# Specific to the Raspberry Pi.
651.if ${MACHINE_CPUARCH} == "aarch64"
652_genet=		genet
653.endif
654
655.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "aarch64" || \
656	${MACHINE_ARCH:Mpowerpc64*}
657_ice=		ice
658.if ${MK_SOURCELESS_UCODE} != "no"
659_ice_ddp=	ice_ddp
660.endif
661.if ${MK_OFED} != "no" || defined(ALL_MODULES)
662.if ${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no"
663_irdma=		irdma
664.endif
665.endif
666.endif
667
668.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" || \
669	${MACHINE_CPUARCH} == "riscv"
670.if !empty(OPT_FDT)
671_if_cgem=	if_cgem
672.endif
673.endif
674
675# These rely on 64bit atomics
676.if ${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
677_mps=		mps
678_mpr=		mpr
679.endif
680
681.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
682SUBDIR+=	ktest
683SUBDIR+=	tests
684.endif
685
686.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
687SUBDIR+=	zfs
688.endif
689
690.if ${MK_SOURCELESS_UCODE} != "no"
691_cxgb=		cxgb
692.endif
693
694.if ${MACHINE_CPUARCH} == "aarch64"
695_armv8crypto=	armv8crypto
696_armv8_rng=	armv8_rng
697_dpaa2=		dpaa2
698_sff=		sff
699_em=		em
700_hyperv=  hyperv
701_vf_i2c=	vf_i2c
702
703.if !empty(OPT_FDT)
704_allwinner=	allwinner
705_dwwdt=		dwwdt
706_enetc=		enetc
707_felix=		felix
708_rockchip=	rockchip
709.endif
710.endif
711
712.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
713.if !empty(OPT_FDT)
714_sdhci_fdt=	sdhci_fdt
715.endif
716_e6000sw=	e6000sw
717_neta=		neta
718.endif
719
720.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
721_agp=		agp
722.if ${MACHINE_CPUARCH} == "i386" || !empty(COMPAT_FREEBSD32_ENABLED)
723_aout=		aout
724.endif
725_bios=		bios
726.if ${MK_SOURCELESS_UCODE} != "no"
727_bxe=		bxe
728.endif
729_cardbus=	cardbus
730_cbb=		cbb
731_cpuctl=	cpuctl
732_cpufreq=	cpufreq
733_dpms=		dpms
734_em=		em
735_et=		et
736_ftgpio=	ftgpio
737_ftwd=		ftwd
738_exca=		exca
739_igc=		igc
740_io=		io
741_itwd=		itwd
742_ix=		ix
743_ixv=		ixv
744.if ${MK_SOURCELESS_UCODE} != "no"
745_lio=		lio
746.endif
747_mana=		mana
748_mgb=		mgb
749_nctgpio=	nctgpio
750_ncthwm=	ncthwm
751_ntb=		ntb
752_ocs_fc=	ocs_fc
753_p2sb=		p2sb
754_qat_c2xxx=	qat_c2xxx
755_qat_c2xxxfw=	qat_c2xxxfw
756_safe=		safe
757_speaker=	speaker
758_splash=	splash
759_syscons=	syscons
760_wbwd=		wbwd
761_wdatwd=	wdatwd
762
763_aac=		aac
764_aacraid=	aacraid
765_acpi=		acpi
766.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
767_aesni=		aesni
768.endif
769_amd_ecc_inject=amd_ecc_inject
770_amdsbwd=	amdsbwd
771_amdsmn=	amdsmn
772_amdtemp=	amdtemp
773_arcmsr=	arcmsr
774_asmc=		asmc
775.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
776_blake2=	blake2
777.endif
778_bytgpio=	bytgpio
779_chvgpio=	chvgpio
780_ciss=		ciss
781_chromebook_platform=	chromebook_platform
782_coretemp=	coretemp
783.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
784_hpt27xx=	hpt27xx
785.endif
786_hptiop=	hptiop
787.if ${MK_SOURCELESS_HOST} != "no" && empty(KCSAN_ENABLED)
788_hptmv=		hptmv
789_hptnr=		hptnr
790_hptrr=		hptrr
791.endif
792_hyperv=	hyperv
793_ichwd=		ichwd
794_ida=		ida
795_intelspi=	intelspi
796_ips=		ips
797_isci=		isci
798_ipw=		ipw
799_iwi=		iwi
800_iwm=		iwm
801_iwn=		iwn
802.if ${MK_SOURCELESS_UCODE} != "no"
803_ipwfw=		ipwfw
804_iwifw=		iwifw
805_iwmfw=		iwmfw
806_iwnfw=		iwnfw
807.endif
808_nfe=		nfe
809_nvram=		nvram
810.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
811_padlock=	padlock
812_padlock_rng=	padlock_rng
813_rdrand_rng=	rdrand_rng
814.endif
815_pchtherm = pchtherm
816_s3=		s3
817_sdhci_acpi=	sdhci_acpi
818_superio=	superio
819_vesa=		vesa
820_viawd=		viawd
821_vmd=		vmd
822_wpi=		wpi
823.if ${MK_SOURCELESS_UCODE} != "no"
824_wpifw=		wpifw
825.endif
826_x86bios=	x86bios
827.endif
828
829.if ${MACHINE_CPUARCH} == "amd64"
830_amdgpio=	amdgpio
831_ccp=		ccp
832_enic=		enic
833_iavf=		iavf
834_ioat=		ioat
835_ixl=		ixl
836_nvdimm=	nvdimm
837_pms=		pms
838_qat=		qat
839.if ${MK_SOURCELESS_UCODE} != "no"
840_qatfw=		qatfw
841.endif
842_qlxge=		qlxge
843_qlxgb=		qlxgb
844_sume=		sume
845.if ${MK_SOURCELESS_UCODE} != "no"
846_qlxgbe=	qlxgbe
847_qlnx=		qlnx
848.endif
849_sfxge=		sfxge
850_sgx=		sgx
851_sgx_linux=	sgx_linux
852_smartpqi=	smartpqi
853_p2sb=		p2sb
854.endif
855
856.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
857.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
858.if ${KERN_OPTS:MSMP}
859_vmm=		vmm
860.endif
861.endif
862.endif
863
864.if ${MACHINE_CPUARCH} == "i386"
865# XXX some of these can move to the general case when de-i386'ed
866# XXX some of these can move now, but are untested on other architectures.
867_3dfx=		3dfx
868_3dfx_linux=	3dfx_linux
869_glxiic=	glxiic
870_glxsb=		glxsb
871_pcfclock=	pcfclock
872_pst=		pst
873_sbni=		sbni
874.endif
875
876.if ${MACHINE_ARCH} == "armv7"
877_cfi=		cfi
878_cpsw=		cpsw
879.endif
880
881.if ${MACHINE_CPUARCH} == "powerpc"
882_aacraid=	aacraid
883_agp=		agp
884_an=		an
885_cardbus=	cardbus
886_cbb=		cbb
887_cfi=		cfi
888_cpufreq=	cpufreq
889_exca=		exca
890_ffec=		ffec
891.endif
892
893.if ${MACHINE_ARCH:Mpowerpc64*} != ""
894_ixl=		ixl
895_nvram=		opal_nvram
896.endif
897
898.if ${MACHINE_CPUARCH} == "powerpc" && ${MACHINE_ARCH} != "powerpcspe"
899# Don't build powermac_nvram for powerpcspe, it's never supported.
900_nvram+=	powermac_nvram
901.endif
902
903.if ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "aarch64"
904_bcm283x_clkman=  bcm283x_clkman
905_bcm283x_pwm=  bcm283x_pwm
906.endif
907
908.if !(${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 110000)
909# LLVM 10 crashes when building if_malo_pci.c, fixed in LLVM11:
910# https://bugs.llvm.org/show_bug.cgi?id=44351
911_malo=	malo
912.endif
913
914SUBDIR+=${MODULES_EXTRA}
915
916.for reject in ${WITHOUT_MODULES}
917SUBDIR:= ${SUBDIR:N${reject}}
918.endfor
919
920.endif # MODULES_OVERRIDE -- Keep last
921
922# Calling kldxref(8) for each module is expensive.
923.if !defined(NO_XREF)
924.MAKEFLAGS+=	-DNO_XREF
925afterinstall: .PHONY
926	${KLDXREF_CMD} ${DESTDIR}${KMODDIR}
927.if defined(NO_ROOT) && defined(METALOG)
928	echo ".${DISTBASE}${KMODDIR}/linker.hints type=file mode=0644 uname=root gname=wheel" | \
929	    cat -l >> ${METALOG}
930.endif
931.endif
932
933SUBDIR:= ${SUBDIR:u:O}
934
935.include <bsd.subdir.mk>
936