xref: /freebsd/sys/modules/Makefile (revision 0f86d40bf58c3eec01effe2ee55c0268fff74da0)
1# $FreeBSD$
2
3SYSDIR?=${SRCTOP}/sys
4.include "${SYSDIR}/conf/kern.opts.mk"
5
6SUBDIR_PARALLEL=
7
8# Modules that include binary-only blobs of microcode should be selectable by
9# MK_SOURCELESS_UCODE option (see below).
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	acl_nfs4 \
23	acl_posix1e \
24	${_acpi} \
25	ae \
26	${_aesni} \
27	age \
28	${_agp} \
29	aha \
30	ahci \
31	${_aic} \
32	aic7xxx \
33	alc \
34	ale \
35	alq \
36	${_amd_ecc_inject} \
37	${_amdsbwd} \
38	${_amdtemp} \
39	amr \
40	${_an} \
41	${_aout} \
42	${_apm} \
43	${_arcmsr} \
44	${_arcnet} \
45	${_armv8crypto} \
46	${_asmc} \
47	ata \
48	ath \
49	ath_pci \
50	${_autofs} \
51	${_auxio} \
52	${_bce} \
53	bfe \
54	bge \
55	bhnd \
56	${_bxe} \
57	${_bios} \
58	${_bktr} \
59	${_bm} \
60	bnxt \
61	bridgestp \
62	bwi \
63	bwn \
64	bwn_pci \
65	${_bytgpio} \
66	cam \
67	${_cardbus} \
68	${_carp} \
69	cas \
70	${_cbb} \
71	cc \
72	cd9660 \
73	cd9660_iconv \
74	${_ce} \
75	${_cfi} \
76	chacha20 \
77	${_chromebook_platform} \
78	${_ciss} \
79	cloudabi \
80	${_cloudabi32} \
81	${_cloudabi64} \
82	${_cm} \
83	${_cmx} \
84	${_coff} \
85	${_coretemp} \
86	${_cp} \
87	${_cpsw} \
88	${_cpuctl} \
89	${_cpufreq} \
90	${_crypto} \
91	${_cryptodev} \
92	${_cs} \
93	${_ctau} \
94	ctl \
95	${_cxgb} \
96	${_cxgbe} \
97	dc \
98	dcons \
99	dcons_crom \
100	de \
101	${_dpms} \
102	${_dpt} \
103	${_drm} \
104	${_drm2} \
105	dummynet \
106	${_ed} \
107	${_efirt} \
108	${_elink} \
109	${_em} \
110	${_ena} \
111	${_ep} \
112	${_epic} \
113	esp \
114	${_et} \
115	evdev \
116	${_ex} \
117	${_exca} \
118	ext2fs \
119	fdc \
120	fdescfs \
121	${_fe} \
122	filemon \
123	firewire \
124	firmware \
125	fuse \
126	${_fxp} \
127	gem \
128	geom \
129	${_glxiic} \
130	${_glxsb} \
131	gpio \
132	hifn \
133	hme \
134	${_hpt27xx} \
135	${_hptiop} \
136	${_hptmv} \
137	${_hptnr} \
138	${_hptrr} \
139	hwpmc \
140	${_hwpmc_mips24k} \
141	${_hwpmc_mips74k} \
142	${_hyperv} \
143	i2c \
144        ${_ibcore} \
145	${_ibcs2} \
146	${_ichwd} \
147	${_ida} \
148	if_bridge \
149	if_disc \
150	if_edsc \
151	${_if_enc} \
152	if_epair \
153	${_if_gif} \
154	${_if_gre} \
155	${_if_me} \
156	if_lagg \
157	${_if_ndis} \
158	${_if_stf} \
159	if_tap \
160	if_tun \
161	if_vlan \
162	if_vxlan \
163	${_iir} \
164	imgact_binmisc \
165	${_intelspi} \
166	${_io} \
167	${_ioat} \
168        ${_ipoib} \
169	${_ipdivert} \
170	${_ipfilter} \
171	${_ipfw} \
172	ipfw_nat \
173	${_ipfw_nat64} \
174	${_ipfw_nptv6} \
175	${_ipfw_pmod} \
176	${_ipmi} \
177	ip6_mroute_mod \
178	ip_mroute_mod \
179	${_ips} \
180	${_ipsec} \
181	${_ipw} \
182	${_ipwfw} \
183	${_isci} \
184	${_iser} \
185	isp \
186	${_ispfw} \
187	${_iwi} \
188	${_iwifw} \
189	${_iwm} \
190	${_iwmfw} \
191	${_iwn} \
192	${_iwnfw} \
193	${_ix} \
194	${_ixv} \
195	${_ixgb} \
196	${_ixl} \
197	${_ixlv} \
198	jme \
199	joy \
200	kbdmux \
201	kgssapi \
202	kgssapi_krb5 \
203	khelp \
204	krpc \
205	ksyms \
206	le \
207	lge \
208	libalias \
209	libiconv \
210	libmbpool \
211	libmchain \
212	${_linprocfs} \
213	${_linsysfs} \
214	${_linux} \
215	${_linux_common} \
216	${_linux64} \
217	linuxkpi \
218	lmc \
219	lpt \
220	mac_biba \
221	mac_bsdextended \
222	mac_ifoff \
223	mac_lomac \
224	mac_mls \
225	mac_none \
226	mac_partition \
227	mac_portacl \
228	mac_seeotheruids \
229	mac_stub \
230	mac_test \
231	malo \
232	md \
233	mdio \
234	mem \
235	mfi \
236	mii \
237	mlx \
238	${_mlx4} \
239	${_mlx4ib} \
240	${_mlx4en} \
241	${_mlx5} \
242	${_mlx5en} \
243	${_mly} \
244	mmc \
245	mmcsd \
246	mpr \
247	mps \
248	mpt \
249	mqueue \
250	mrsas \
251	msdosfs \
252	msdosfs_iconv \
253	${_mse} \
254	msk \
255	${_mthca} \
256	mvs \
257	mwl \
258	${_mwlfw} \
259	mxge \
260	my \
261	${_nandfs} \
262	${_nandsim} \
263	${_ncr} \
264	${_nctgpio} \
265	${_ncv} \
266	${_ndis} \
267	${_netgraph} \
268	${_nfe} \
269	nfscl \
270	nfscommon \
271	nfsd \
272	nfslock \
273	nfslockd \
274	nfssvc \
275	nge \
276	nmdm \
277	${_nsp} \
278	nullfs \
279	${_ntb} \
280	${_nvd} \
281	${_nvme} \
282	${_nvram} \
283	${_nxge} \
284	oce \
285	otus \
286	${_otusfw} \
287	ow \
288	${_padlock} \
289	${_padlock_rng} \
290	${_pccard} \
291	${_pcfclock} \
292	pcn \
293	${_pf} \
294	${_pflog} \
295	${_pfsync} \
296	plip \
297	${_pms} \
298	ppbus \
299	ppc \
300	ppi \
301	pps \
302	procfs \
303	proto \
304	pseudofs \
305	${_pst} \
306	pty  \
307	puc \
308	${_qlxge} \
309	${_qlxgb} \
310	${_qlxgbe} \
311	${_qlnx} \
312	ral \
313	${_ralfw} \
314	${_random_fortuna} \
315	${_random_yarrow} \
316	${_random_other} \
317	rc4 \
318	${_rdma} \
319	${_rdrand_rng} \
320	re \
321	rl \
322	rtwn \
323	rtwn_pci \
324	rtwn_usb \
325	${_rtwnfw} \
326	${_s3} \
327	${_safe} \
328	${_sbni} \
329	scc \
330	${_scsi_low} \
331	sdhci \
332	${_sdhci_acpi} \
333	sdhci_pci \
334	sem \
335	send \
336	${_sf} \
337	${_sfxge} \
338	sge \
339	siba_bwn \
340	siftr \
341	siis \
342	sis \
343	sk \
344	smbfs \
345	sn \
346	snp \
347	sound \
348	${_speaker} \
349	spigen \
350	${_splash} \
351	${_sppp} \
352	ste \
353	${_stg} \
354	stge \
355	${_sym} \
356	${_syscons} \
357	sysvipc \
358	tcp \
359	${_ti} \
360	tl \
361	tmpfs \
362	${_toecore} \
363	${_tpm} \
364	trm \
365	${_twa} \
366	twe \
367	tws \
368	tx \
369	${_txp} \
370	uart \
371	ubsec \
372	udf \
373	udf_iconv \
374	ufs \
375	uinput \
376	unionfs \
377	usb \
378	${_vesa} \
379	${_virtio} \
380	vge \
381	${_viawd} \
382	videomode \
383	vkbd \
384	${_vmm} \
385	${_vmware} \
386	${_vpo} \
387	vr \
388	vte \
389	vx \
390	${_vxge} \
391	wb \
392	${_wbwd} \
393	${_wi} \
394	wlan \
395	wlan_acl \
396	wlan_amrr \
397	wlan_ccmp \
398	wlan_rssadapt \
399	wlan_tkip \
400	wlan_wep \
401	wlan_xauth \
402	${_wpi} \
403	${_wpifw} \
404	${_x86bios} \
405	${_xe} \
406	xl \
407	zlib
408
409.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES)
410_autofs=	autofs
411.endif
412
413.if ${MK_CDDL} != "no" || defined(ALL_MODULES)
414.if (${MACHINE_CPUARCH} != "arm" || ${MACHINE_ARCH:Marmv6*} != "") && \
415	${MACHINE_CPUARCH} != "mips" && \
416	${MACHINE_CPUARCH} != "sparc64"
417SUBDIR+=	dtrace
418.endif
419SUBDIR+=	opensolaris
420.endif
421
422.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
423.if exists(${SRCTOP}/sys/opencrypto)
424_crypto=	crypto
425_cryptodev=	cryptodev
426_random_fortuna=random_fortuna
427_random_yarrow=	random_yarrow
428_random_other=	random_other
429.endif
430.endif
431
432.if ${MK_CUSE} != "no" || defined(ALL_MODULES)
433SUBDIR+=	cuse
434.endif
435
436.if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \
437	defined(ALL_MODULES)
438_carp=		carp
439_toecore=	toecore
440_if_enc=	if_enc
441_if_gif=	if_gif
442_if_gre=	if_gre
443_ipfw_pmod=	ipfw_pmod
444.if ${MK_IPSEC_SUPPORT} != "no"
445_ipsec=		ipsec
446.endif
447.endif
448
449.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
450	defined(ALL_MODULES)
451_if_stf=	if_stf
452.endif
453
454.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES)
455_if_me=		if_me
456_ipdivert=	ipdivert
457_ipfw=		ipfw
458.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
459_ipfw_nat64=	ipfw_nat64
460.endif
461.endif
462
463.if ${MK_INET6_SUPPORT} != "no" || defined(ALL_MODULES)
464_ipfw_nptv6=	ipfw_nptv6
465.endif
466
467.if ${MK_IPFILTER} != "no" || defined(ALL_MODULES)
468_ipfilter=	ipfilter
469.endif
470
471.if ${MK_ISCSI} != "no" || defined(ALL_MODULES)
472SUBDIR+=	cfiscsi
473SUBDIR+=	iscsi
474SUBDIR+=	iscsi_initiator
475.endif
476
477.if ${MK_NAND} != "no" || defined(ALL_MODULES)
478_nandfs=	nandfs
479_nandsim=	nandsim
480.endif
481
482.if ${MK_NETGRAPH} != "no" || defined(ALL_MODULES)
483_netgraph=	netgraph
484.endif
485
486.if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \
487	${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES)
488_pf=		pf
489_pflog=		pflog
490.if ${MK_INET_SUPPORT} != "no"
491_pfsync=	pfsync
492.endif
493.endif
494
495.if ${MK_SOURCELESS_UCODE} != "no"
496_bce=		bce
497_fxp=		fxp
498_ispfw=		ispfw
499_sf=		sf
500_ti=		ti
501_txp=		txp
502
503.if ${MACHINE_CPUARCH} != "mips"
504_mwlfw=		mwlfw
505_otusfw=	otusfw
506_ralfw=		ralfw
507_rtwnfw=	rtwnfw
508.endif
509.endif
510
511.if ${MK_SOURCELESS_UCODE} != "no" && ${MACHINE_CPUARCH} != "arm" && \
512	${MACHINE_CPUARCH} != "mips" && \
513	${MACHINE_ARCH} != "powerpc" && ${MACHINE_ARCH} != "powerpcspe" && \
514	${MACHINE_CPUARCH} != "riscv"
515_cxgbe=		cxgbe
516.endif
517
518.if ${MK_TESTS} != "no" || defined(ALL_MODULES)
519SUBDIR+=	tests
520.endif
521
522.if ${MK_ZFS} != "no" || defined(ALL_MODULES)
523SUBDIR+=	zfs
524.endif
525
526.if (${MACHINE_CPUARCH} == "mips" && ${MACHINE_ARCH:Mmips64} == "")
527_hwpmc_mips24k=	hwpmc_mips24k
528_hwpmc_mips74k=	hwpmc_mips74k
529.endif
530
531.if ${MACHINE_CPUARCH} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
532	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
533	${MACHINE_CPUARCH} != "riscv"
534_syscons=	syscons
535_vpo=		vpo
536.endif
537
538.if ${MACHINE_CPUARCH} != "mips"
539# no BUS_SPACE_UNSPECIFIED
540# No barrier instruction support (specific to this driver)
541_sym=		sym
542# intr_disable() is a macro, causes problems
543.if ${MK_SOURCELESS_UCODE} != "no"
544_cxgb=		cxgb
545.endif
546.endif
547
548.if ${MACHINE_CPUARCH} == "aarch64"
549_armv8crypto=	armv8crypto
550_em=		em
551.endif
552
553.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
554_agp=		agp
555_an=		an
556_aout=		aout
557_bios=		bios
558_bktr=		bktr
559_bxe=		bxe
560_cardbus=	cardbus
561_cbb=		cbb
562_cpuctl=	cpuctl
563_cpufreq=	cpufreq
564_cs=		cs
565_dpms=		dpms
566_drm=		drm
567_drm2=		drm2
568_ed=		ed
569_em=		em
570_ena=		ena
571_ep=		ep
572_et=		et
573_exca=		exca
574_fe=		fe
575.if ${MK_OFED} != "no" || defined(ALL_MODULES)
576_ibcore=        ibcore
577.endif
578_if_ndis=	if_ndis
579_io=		io
580.if ${MK_OFED} != "no" || defined(ALL_MODULES)
581_ipoib=         ipoib
582_iser=		iser
583.endif
584_ix=		ix
585_ixv=		ixv
586_linprocfs=	linprocfs
587_linsysfs=	linsysfs
588_linux=		linux
589_nctgpio=	nctgpio
590_ndis=		ndis
591_pccard=	pccard
592.if ${MK_OFED} != "no" || defined(ALL_MODULES)
593_rdma=		rdma
594.endif
595_safe=		safe
596_scsi_low=	scsi_low
597_speaker=	speaker
598_splash=	splash
599_sppp=		sppp
600_vmware=	vmware
601_vxge=  	vxge
602_wbwd=		wbwd
603_wi=		wi
604_xe=		xe
605
606_aac=		aac
607_aacraid=	aacraid
608_acpi=		acpi
609.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
610_aesni=		aesni
611.endif
612_amd_ecc_inject=amd_ecc_inject
613_amdsbwd=	amdsbwd
614_amdtemp=	amdtemp
615_arcmsr=	arcmsr
616_asmc=		asmc
617_bytgpio=	bytgpio
618_ciss=		ciss
619_chromebook_platform=	chromebook_platform
620_cmx=		cmx
621_coretemp=	coretemp
622.if ${MK_SOURCELESS_HOST} != "no"
623_hpt27xx=	hpt27xx
624.endif
625_hptiop=	hptiop
626.if ${MK_SOURCELESS_HOST} != "no"
627_hptmv=		hptmv
628_hptnr=		hptnr
629_hptrr=		hptrr
630.endif
631_hyperv=	hyperv
632_ichwd=		ichwd
633_ida=		ida
634_iir=		iir
635_intelspi=	intelspi
636_ipmi=		ipmi
637_ips=		ips
638_isci=		isci
639_ipw=		ipw
640_iwi=		iwi
641_iwm=		iwm
642_iwn=		iwn
643_ixgb=		ixgb
644.if ${MK_SOURCELESS_UCODE} != "no"
645_ipwfw=		ipwfw
646_iwifw=		iwifw
647_iwmfw=		iwmfw
648_iwnfw=		iwnfw
649.endif
650_mlx4=		mlx4
651_mlx5=		mlx5
652.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
653	defined(ALL_MODULES)
654_mlx4en=	mlx4en
655_mlx5en=	mlx5en
656.endif
657.if ${MK_OFED} != "no" || defined(ALL_MODULES)
658_mlx4ib=	mlx4ib
659.endif
660_mly=		mly
661.if ${MK_OFED} != "no" || defined(ALL_MODULES)
662_mthca=		mthca
663.endif
664_nfe=		nfe
665_nvd=		nvd
666_nvme=		nvme
667_nvram=		nvram
668_nxge=		nxge
669.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
670_padlock=	padlock
671_padlock_rng=	padlock_rng
672_rdrand_rng=	rdrand_rng
673.endif
674_s3=		s3
675_sdhci_acpi=	sdhci_acpi
676_tpm=		tpm
677_twa=		twa
678_vesa=		vesa
679_viawd=		viawd
680_virtio=	virtio
681_wpi=		wpi
682.if ${MK_SOURCELESS_UCODE} != "no"
683_wpifw=		wpifw
684.endif
685_x86bios=	x86bios
686.endif
687
688.if ${MACHINE_CPUARCH} == "amd64"
689_efirt=		efirt
690_ioat=		ioat
691_ixl=		ixl
692_ixlv=		ixlv
693_linux64=	linux64
694_linux_common=	linux_common
695_ntb=		ntb
696_pms=		pms
697_qlxge=		qlxge
698_qlxgb=		qlxgb
699_qlxgbe=	qlxgbe
700_qlnx=		qlnx
701_sfxge=		sfxge
702
703.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
704_vmm=		vmm
705.endif
706.endif
707
708.if ${MACHINE_CPUARCH} == "i386"
709# XXX some of these can move to the general case when de-i386'ed
710# XXX some of these can move now, but are untested on other architectures.
711_3dfx=		3dfx
712_3dfx_linux=	3dfx_linux
713_aic=		aic
714_apm=		apm
715_arcnet=	arcnet
716.if ${MK_SOURCELESS_UCODE} != "no"
717_ce=		ce
718.endif
719_coff=		coff
720.if ${MK_SOURCELESS_UCODE} != "no"
721_cp=		cp
722.endif
723_elink=		elink
724_glxiic=	glxiic
725_glxsb=		glxsb
726#_ibcs2=		ibcs2
727_mse=		mse
728_ncr=		ncr
729_ncv=		ncv
730_nsp=		nsp
731_pcfclock=	pcfclock
732_pst=		pst
733_sbni=		sbni
734_stg=		stg
735_cm=		cm
736.if ${MK_SOURCELESS_UCODE} != "no"
737_ctau=		ctau
738.endif
739_dpt=		dpt
740_ex=		ex
741.endif
742
743.if ${MACHINE_CPUARCH} == "arm"
744_cfi=		cfi
745_cpsw=		cpsw
746.endif
747
748.if ${MACHINE_CPUARCH} == "powerpc"
749_agp=		agp
750_an=		an
751_bm=		bm
752_cardbus=	cardbus
753_cbb=		cbb
754_cfi=		cfi
755_cpufreq=	cpufreq
756_drm=		drm
757_exca=		exca
758_pccard=	pccard
759_wi=		wi
760.endif
761
762.if ${MACHINE_ARCH} == "powerpc64"
763_drm2=		drm2
764.endif
765.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
766# Don't build powermac_nvram for powerpcspe, it's never supported.
767_nvram=		powermac_nvram
768.endif
769
770.if ${MACHINE_CPUARCH} == "sparc64"
771_auxio=		auxio
772_em=		em
773_epic=		epic
774.endif
775
776.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
777     ${MACHINE_CPUARCH} == "i386")
778_cloudabi32=	cloudabi32
779.endif
780.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
781_cloudabi64=	cloudabi64
782.endif
783
784.endif
785
786SUBDIR+=${MODULES_EXTRA}
787
788.for reject in ${WITHOUT_MODULES}
789SUBDIR:= ${SUBDIR:N${reject}}
790.endfor
791
792# Calling kldxref(8) for each module is expensive.
793.if !defined(NO_XREF)
794.MAKEFLAGS+=	-DNO_XREF
795afterinstall: .PHONY
796	@if type kldxref >/dev/null 2>&1; then \
797		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
798		kldxref ${DESTDIR}${KMODDIR}; \
799	fi
800.endif
801
802.include "${SYSDIR}/conf/config.mk"
803
804SUBDIR:= ${SUBDIR:u:O}
805
806.include <bsd.subdir.mk>
807