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