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