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