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