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