xref: /freebsd/sys/modules/Makefile (revision 87b2cfcecfa519b11313951f10e6a4076d9f595a)
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	${_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	${_chromebook_platform} \
77	${_ciss} \
78	cloudabi \
79	${_cloudabi32} \
80	${_cloudabi64} \
81	${_cm} \
82	${_cmx} \
83	${_coff} \
84	${_coretemp} \
85	${_cp} \
86	${_cpsw} \
87	${_cpuctl} \
88	${_cpufreq} \
89	${_crypto} \
90	${_cryptodev} \
91	${_cs} \
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	evdev \
115	${_ex} \
116	${_exca} \
117	ext2fs \
118	${_fatm} \
119	fdc \
120	fdescfs \
121	${_fe} \
122	filemon \
123	firewire \
124	firmware \
125	fuse \
126	${_fxp} \
127	gem \
128	geom \
129	${_glxiic} \
130	${_glxsb} \
131	gpio \
132	hatm \
133	hifn \
134	hme \
135	${_hpt27xx} \
136	${_hptiop} \
137	${_hptmv} \
138	${_hptnr} \
139	${_hptrr} \
140	hwpmc \
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	${_ipmi} \
175	ip6_mroute_mod \
176	ip_mroute_mod \
177	${_ips} \
178	${_ipw} \
179	${_ipwfw} \
180	${_isci} \
181	${_iser} \
182	isp \
183	${_ispfw} \
184	${_iwi} \
185	${_iwifw} \
186	${_iwm} \
187	${_iwmfw} \
188	${_iwn} \
189	${_iwnfw} \
190	${_ix} \
191	${_ixv} \
192	${_ixgb} \
193	${_ixl} \
194	${_ixlv} \
195	jme \
196	joy \
197	kbdmux \
198	kgssapi \
199	kgssapi_krb5 \
200	khelp \
201	krpc \
202	ksyms \
203	le \
204	lge \
205	libalias \
206	libiconv \
207	libmbpool \
208	libmchain \
209	${_linprocfs} \
210	${_linsysfs} \
211	${_linux} \
212	${_linux_common} \
213	${_linux64} \
214	linuxkpi \
215	lmc \
216	lpt \
217	mac_biba \
218	mac_bsdextended \
219	mac_ifoff \
220	mac_lomac \
221	mac_mls \
222	mac_none \
223	mac_partition \
224	mac_portacl \
225	mac_seeotheruids \
226	mac_stub \
227	mac_test \
228	malo \
229	md \
230	mdio \
231	mem \
232	mfi \
233	mii \
234	mlx \
235	${_mlx4} \
236	${_mlx4ib} \
237	${_mlx4en} \
238	${_mlx5} \
239	${_mlx5en} \
240	${_mly} \
241	mmc \
242	mmcsd \
243	mpr \
244	mps \
245	mpt \
246	mqueue \
247	mrsas \
248	msdosfs \
249	msdosfs_iconv \
250	${_mse} \
251	msk \
252	${_mthca} \
253	mvs \
254	mwl \
255	${_mwlfw} \
256	mxge \
257	my \
258	${_nandfs} \
259	${_nandsim} \
260	${_ncr} \
261	${_nctgpio} \
262	${_ncv} \
263	${_ndis} \
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	${_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	rtwn_pci \
321	rtwn_usb \
322	${_rtwnfw} \
323	${_s3} \
324	${_safe} \
325	${_sbni} \
326	scc \
327	${_scsi_low} \
328	sdhci \
329	${_sdhci_acpi} \
330	sdhci_pci \
331	sem \
332	send \
333	${_sf} \
334	${_sfxge} \
335	sge \
336	siba_bwn \
337	siftr \
338	siis \
339	sis \
340	sk \
341	smbfs \
342	sn \
343	snp \
344	sound \
345	${_speaker} \
346	${_splash} \
347	${_sppp} \
348	ste \
349	${_stg} \
350	stge \
351	${_streams} \
352	${_svr4} \
353	${_sym} \
354	${_syscons} \
355	sysvipc \
356	${_ti} \
357	${_tcp_fastpath} \
358	tests/framework \
359	tests/callout_test \
360	tl \
361	tmpfs \
362	${_toecore} \
363	${_tpm} \
364	trm \
365	${_twa} \
366	twe \
367	tws \
368	tx \
369	${_txp} \
370	uart \
371	ubsec \
372	udf \
373	udf_iconv \
374	ufs \
375	uinput \
376	unionfs \
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_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} != "aarch64" && ${MACHINE_CPUARCH} != "arm" && \
524	${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "powerpc" && \
525	${MACHINE_CPUARCH} != "riscv"
526_syscons=	syscons
527_vpo=		vpo
528.endif
529
530.if ${MACHINE_CPUARCH} != "mips"
531# no BUS_SPACE_UNSPECIFIED
532# No barrier instruction support (specific to this driver)
533_sym=		sym
534# intr_disable() is a macro, causes problems
535.if ${MK_SOURCELESS_UCODE} != "no"
536_cxgb=		cxgb
537.endif
538.endif
539
540.if ${MACHINE_CPUARCH} == "aarch64"
541_armv8crypto=	armv8crypto
542_em=		em
543.endif
544
545.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
546_agp=		agp
547_an=		an
548_aout=		aout
549_bios=		bios
550_bktr=		bktr
551_bxe=		bxe
552_cardbus=	cardbus
553_cbb=		cbb
554_cpuctl=	cpuctl
555_cpufreq=	cpufreq
556_cs=		cs
557_dpms=		dpms
558_drm=		drm
559_drm2=		drm2
560_ed=		ed
561_em=		em
562_ep=		ep
563_et=		et
564_exca=		exca
565_fe=		fe
566.if ${MK_OFED} != "no" || defined(ALL_MODULES)
567_ibcore=        ibcore
568.endif
569_if_ndis=	if_ndis
570_io=		io
571.if ${MK_OFED} != "no" || defined(ALL_MODULES)
572_ipoib=         ipoib
573_iser=		iser
574.endif
575_ix=		ix
576_ixv=		ixv
577_linprocfs=	linprocfs
578_linsysfs=	linsysfs
579_linux=		linux
580_nctgpio=	nctgpio
581_ndis=		ndis
582_pccard=	pccard
583.if ${MK_OFED} != "no" || defined(ALL_MODULES)
584_rdma=		rdma
585.endif
586_safe=		safe
587_scsi_low=	scsi_low
588_speaker=	speaker
589_splash=	splash
590_sppp=		sppp
591_vmware=	vmware
592_vxge=  	vxge
593_wbwd=		wbwd
594_wi=		wi
595_xe=		xe
596
597_aac=		aac
598_aacraid=	aacraid
599_acpi=		acpi
600.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
601_aesni=		aesni
602.endif
603_amdsbwd=	amdsbwd
604_amdtemp=	amdtemp
605_arcmsr=	arcmsr
606_asmc=		asmc
607_bytgpio=	bytgpio
608_ciss=		ciss
609_chromebook_platform=	chromebook_platform
610_cmx=		cmx
611_coretemp=	coretemp
612.if ${MK_SOURCELESS_HOST} != "no"
613_hpt27xx=	hpt27xx
614.endif
615_hptiop=	hptiop
616.if ${MK_SOURCELESS_HOST} != "no"
617_hptmv=		hptmv
618_hptnr=		hptnr
619_hptrr=		hptrr
620.endif
621_hyperv=	hyperv
622_ichwd=		ichwd
623_ida=		ida
624_iir=		iir
625_intelspi=	intelspi
626_ipmi=		ipmi
627_ips=		ips
628_isci=		isci
629_ipw=		ipw
630_iwi=		iwi
631_iwm=		iwm
632_iwn=		iwn
633_ixgb=		ixgb
634.if ${MK_SOURCELESS_UCODE} != "no"
635_ipwfw=		ipwfw
636_iwifw=		iwifw
637_iwmfw=		iwmfw
638_iwnfw=		iwnfw
639.endif
640_mlx4=		mlx4
641_mlx5=		mlx5
642.if (${MK_INET_SUPPORT} != "no" && ${MK_INET6_SUPPORT} != "no") || \
643	defined(ALL_MODULES)
644_mlx4en=	mlx4en
645_mlx5en=	mlx5en
646.endif
647.if ${MK_OFED} != "no" || defined(ALL_MODULES)
648_mlx4ib=	mlx4ib
649.endif
650_mly=		mly
651.if ${MK_OFED} != "no" || defined(ALL_MODULES)
652_mthca=		mthca
653.endif
654_nfe=		nfe
655_nvd=		nvd
656_nvme=		nvme
657_nvram=		nvram
658_nxge=		nxge
659.if ${MK_CRYPT} != "no" || defined(ALL_MODULES)
660_padlock=	padlock
661_padlock_rng=	padlock_rng
662_rdrand_rng=	rdrand_rng
663.endif
664_s3=		s3
665_sdhci_acpi=	sdhci_acpi
666_tpm=		tpm
667_twa=		twa
668_vesa=		vesa
669_viawd=		viawd
670_virtio=	virtio
671_wpi=		wpi
672.if ${MK_SOURCELESS_UCODE} != "no"
673_wpifw=		wpifw
674.endif
675_x86bios=	x86bios
676.endif
677
678.if ${MACHINE_CPUARCH} == "amd64"
679_efirt=		efirt
680_ioat=		ioat
681_ixl=		ixl
682_ixlv=		ixlv
683_linux64=	linux64
684_linux_common=	linux_common
685_ntb=		ntb
686_pms=		pms
687_qlxge=		qlxge
688_qlxgb=		qlxgb
689_qlxgbe=	qlxgbe
690_sfxge=		sfxge
691
692.if ${MK_BHYVE} != "no" || defined(ALL_MODULES)
693_vmm=		vmm
694.endif
695.endif
696
697.if ${MACHINE_CPUARCH} == "i386"
698# XXX some of these can move to the general case when de-i386'ed
699# XXX some of these can move now, but are untested on other architectures.
700_3dfx=		3dfx
701_3dfx_linux=	3dfx_linux
702_aic=		aic
703_apm=		apm
704_arcnet=	arcnet
705.if ${MK_SOURCELESS_UCODE} != "no"
706_ce=		ce
707.endif
708_coff=		coff
709.if ${MK_SOURCELESS_UCODE} != "no"
710_cp=		cp
711.endif
712_elink=		elink
713_glxiic=	glxiic
714_glxsb=		glxsb
715#_ibcs2=		ibcs2
716_mse=		mse
717_ncr=		ncr
718_ncv=		ncv
719_nsp=		nsp
720_pcfclock=	pcfclock
721_pst=		pst
722_sbni=		sbni
723_streams=	streams
724_stg=		stg
725_svr4=		svr4
726.if ${MK_EISA} != "no"
727_ahb=		ahb
728.endif
729_cm=		cm
730.if ${MK_SOURCELESS_UCODE} != "no"
731_ctau=		ctau
732.endif
733_dpt=		dpt
734_ex=		ex
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_pccard=	pccard
753_wi=		wi
754.endif
755
756.if ${MACHINE_ARCH} == "powerpc64"
757_drm2=		drm2
758.endif
759.if ${MACHINE_ARCH} == "powerpc64" || ${MACHINE_ARCH} == "powerpc"
760# Don't build powermac_nvram for powerpcspe, it's never supported.
761_nvram=		powermac_nvram
762.endif
763
764.if ${MACHINE_CPUARCH} == "sparc64"
765_auxio=		auxio
766_em=		em
767_epic=		epic
768.endif
769
770.if (${MACHINE_CPUARCH} == "amd64" || ${MACHINE_ARCH} == "armv6" || \
771     ${MACHINE_CPUARCH} == "i386")
772_cloudabi32=	cloudabi32
773.endif
774.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64"
775_cloudabi64=	cloudabi64
776.endif
777
778.endif
779
780SUBDIR+=${MODULES_EXTRA}
781
782.for reject in ${WITHOUT_MODULES}
783SUBDIR:= ${SUBDIR:N${reject}}
784.endfor
785
786# Calling kldxref(8) for each module is expensive.
787.if !defined(NO_XREF)
788.MAKEFLAGS+=	-DNO_XREF
789afterinstall: .PHONY
790	@if type kldxref >/dev/null 2>&1; then \
791		${ECHO} kldxref ${DESTDIR}${KMODDIR}; \
792		kldxref ${DESTDIR}${KMODDIR}; \
793	fi
794.endif
795
796.include "${SYSDIR}/conf/config.mk"
797
798SUBDIR:= ${SUBDIR:u:O}
799
800.include <bsd.subdir.mk>
801